18DOWNLOAD_URL =
'https://dl.k8s.io/release/%s/bin/linux/amd64/kubectl' % VERSION
19SHA256_URL =
'https://dl.k8s.io/%s/bin/linux/amd64/kubectl.sha256' % VERSION
23 """Create the asset."""
24 subprocess.check_call([
'curl',
'-LO', DOWNLOAD_URL], cwd=target_dir)
25 sha256 = requests.get(SHA256_URL).text
27 [
'sha256sum',
'--check'],
29 stdout=subprocess.PIPE,
30 stderr=subprocess.STDOUT,
31 stdin=subprocess.PIPE)
32 output = p.communicate(
33 input=(sha256 +
' kubectl').
encode(
'utf-8'))[0].
decode(
'utf-8')
34 if 'OK' not in output:
35 raise ValueError(
'Got wrong checksum for kubectl: %s' % output)
36 subprocess.check_call([
'chmod',
'a+x',
'kubectl'], cwd=target_dir)
40 parser = argparse.ArgumentParser()
41 parser.add_argument(
'--target_dir',
'-t', required=
True)
42 args = parser.parse_args()
46if __name__ ==
'__main__':
static void encode(uint8_t output[16], const uint32_t input[4])
def create_asset(target_dir)
static DecodeResult decode(std::string path)