Verify if the components/tools required are present and if they are the correct version.
()
| 42 | |
| 43 | |
| 44 | def 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 | |
| 67 | def forgeops_dependencies(legacy): |
no test coverage detected