runway.env_mgr.kbenv module

Kubectl version management.

runway.env_mgr.kbenv.verify_kb_release(kb_url, download_dir, filename)[source]

Compare checksum and exit if it doesn’t match.

Different releases provide varying checksum files. To account for this, start at SHA512 and work down to the first available checksum.

requests is used for downloading these small files because of difficulty in getting 404 status from urllib on py2. Once py2 support is dropped, downloads can be moved to urllib.

https://stackoverflow.com/questions/1308542/how-to-catch-404-error-in-urllib-urlretrieve

runway.env_mgr.kbenv.download_kb_release(version, versions_dir, kb_platform=None, arch=None)[source]

Download kubectl and return path to it.

runway.env_mgr.kbenv.get_version_requested(path)[source]

Return string listing requested kubectl version.

class runway.env_mgr.kbenv.KBEnvManager(path=None)[source]

Bases: runway.env_mgr.EnvManager

kubectl version management.

Designed to be compatible with https://github.com/alexppg/kbenv.

Initialize class.

install(version_requested=None)[source]

Ensure kubectl is available.