renamed python script according to workflow.

This commit is contained in:
Tommy Barnes 2022-01-04 15:57:47 -05:00
parent e5b547ef50
commit e7ad6d6256
2 changed files with 4 additions and 32 deletions

View file

@ -13,6 +13,9 @@ jobs:
run-integration-test: run-integration-test:
name: Validate release and master branch name: Validate release and master branch
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
KUBECONFIG: /home/runner/.kube/config
PR_BASE_REF: ${{ github.event.pull_request.base.ref }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
name: Checkout from PR branch name: Checkout from PR branch
@ -35,7 +38,7 @@ jobs:
run: pip install requests run: pip install requests
- name: Validate kubectl setup - name: Validate kubectl setup
run: python test/validate-kubectl.py latest run: python ./test/validate-kubectl.py latest
- name: Setup kubectl - name: Setup kubectl
uses: ./setup-kubectl uses: ./setup-kubectl

View file

@ -1,31 +0,0 @@
import os, sys, json, requests, time
version_to_check = sys.argv[1]
version_info = None
PASSED = False
try:
print('kubectl version --client -o json')
version_info = json.load(os.popen('kubectl version --client -o json'))
except Exception as ex:
sys.exit('kubectl not installed')
try:
if version_to_check == 'latest':
response = None
time_to_sleep = 2
for _ in range(10):
response = requests.get('https://storage.googleapis.com/kubernetes-release/release/stable.txt')
if response.status_code == 200:
break
print('Failed to obtain latest version info, retrying.')
time.sleep(time_to_sleep)
time_to_sleep *= 2
version_to_check = response.content.decode('utf-8')
PASSED = True if version_info['clientVersion']['gitVersion'] == version_to_check else False
except:
pass
if not PASSED:
sys.exit('Setting up of '+version_to_check+' kubectl failed')
print('Test passed')