Skip to content

5.0.1 Changelog

5.0.1 Changelog #117

name: 'Minikube Integration Tests'
on:
pull_request:
jobs:
aks-minikube-integration-tests:
name: Generic Secret Validation
runs-on: ubuntu-latest
env:
KUBECONFIG: /home/runner/.kube/config
PR_BASE_REF: ${{ github.event.pull_request.base.ref }}
steps:
- name: Install conntrack
run: sudo apt-get install -y conntrack
- id: setup-minikube
name: Setup Minikube
uses: medyagh/setup-minikube@latest
with:
minikube-version: 1.24.0
kubernetes-version: 1.22.3
driver: 'none'
timeout-minutes: 3
- uses: actions/checkout@v1
- id: action-npm-build
name: npm install and build
run: |
echo $PR_BASE_REF
if [[ $PR_BASE_REF != releases/* ]]; then
npm install
npm run build
fi
- id: call-create-secret
name: execute k8s-create-secret
uses: ./
with:
secret-name: integration-test-secret
secret-type: generic
string-data: '{ "testKey": "testValue" }'
- id: validate-secret-creation
name: validate secret creation
run: |
export VAL="$(kubectl get secret integration-test-secret --template {{.data.testKey}}| base64 -d)"
if [ "$VAL" = "testValue" ]; then
echo "successful secret creation"
else
echo "failed to read secret after creation"
echo "VAL=$VAL"
exit 1
fi
aks-minikube-docker-registry-tests:
name: Registry Secret Kubectl Validation
runs-on: ubuntu-latest
env:
KUBECONFIG: /home/runner/.kube/config
PR_BASE_REF: ${{ github.event.pull_request.base.ref }}
steps:
- name: Install conntrack
run: sudo apt-get install -y conntrack
- id: setup-minikube
name: Setup Minikube
uses: medyagh/setup-minikube@latest
with:
minikube-version: 1.24.0
kubernetes-version: 1.22.3
driver: 'none'
timeout-minutes: 3
- uses: actions/checkout@v1
- id: action-npm-build
name: npm install and build
run: |
echo $PR_BASE_REF
if [[ $PR_BASE_REF != releases/* ]]; then
npm install
npm run build
fi
- id: create-secret-action
name: create test secret with k8s-create-secret
uses: ./
with:
secret-name: action-test-secret
container-registry-url: 'test.registry.com'
container-registry-username: 'test-User1'
container-registry-password: 'test-Pass1'
- id: create-secret-kubectl
name: create test secret with kubectl
run: |
kubectl create secret docker-registry kubectl-test-secret --docker-username=test-User1 --docker-password=test-Pass1 --docker-server=test.registry.com
- id: validate-secret-value-equality
name: validate secret value equality
run: |
export KUBECTLVALUE="$(kubectl get secret kubectl-test-secret --template {{.data}})"
export ACTIONVALUE="$(kubectl get secret action-test-secret --template {{.data}})"
echo "ACTIONVALUE=$ACTIONVALUE"
echo "KUBECTLVALUE=$KUBECTLVALUE"
if [ "$ACTIONVALUE" = "$KUBECTLVALUE" ]; then
echo "secret values match"
else
echo "action-created secret value does not match kubectl-created secret"
exit 1
fi
- id: validate-secret-type-equality
name: validate secret type equality
run: |
export KUBECTLTYPE="$(kubectl get secret kubectl-test-secret --template {{.type}})"
export ACTIONTYPE="$(kubectl get secret action-test-secret --template {{.type}})"
echo "ACTIONTYPE=$ACTIONTYPE"
echo "KUBECTLTYPE=$KUBECTLTYPE"
if [ "$ACTIONTYPE" = "$KUBECTLTYPE" ]; then
echo "secret types match"
else
echo "action-created secret type does not match kubectl-created secret type"
exit 1
fi