MCPcopy Create free account
hub / github.com/ForgeRock/forgeops / check_base_toolset

Function check_base_toolset

lib/python/forgeops_dependencies.py:44–64  ·  view source on GitHub ↗

Verify if the components/tools required are present and if they are the correct version.

()

Source from the content-addressed store, hash-verified

42
43
44def check_base_toolset():
45 """
46 Verify if the components/tools required are present and if they are the correct version.
47 """
48 # print('Checking kubectl version')
49 _, output, _ = run('kubectl', 'version --client=true -o json', cstdout=True)
50 output = json.loads(output.decode('utf-8'))['clientVersion']['gitVersion']
51 check_component_version('kubectl', re.split('-|_|\+', output)[0])
52
53 # print('Attempting to check Kubernetes server version')
54 try:
55 _, output, _ = run('kubectl', 'version -o json', cstdout=True, cstderr=True)
56 output = json.loads(output.decode('utf-8'))['serverVersion']['gitVersion']
57 except:
58 message('Could not verify Kubernetes server version. Continuing for now.')
59 check_component_version('kubernetes', re.split('-|_|\+', output)[0])
60
61 # print('Checking kustomize version')
62 _, ver, _ = run('kustomize', 'version', cstdout=True)
63 ver = ver.decode('ascii')
64 check_component_version('kustomize', ver)
65
66
67def forgeops_dependencies(legacy):

Callers 1

forgeops_dependenciesFunction · 0.85

Calls 3

runFunction · 0.90
messageFunction · 0.90
check_component_versionFunction · 0.85

Tested by

no test coverage detected