Skip to content

Bump golang from 1.20.5 to 1.21.0 #229

Bump golang from 1.20.5 to 1.21.0

Bump golang from 1.20.5 to 1.21.0 #229

Workflow file for this run

name: Lint and Test Chart
on: pull_request
jobs:
go-test:
runs-on: ubuntu-latest
env:
IMAGE: jainishshah17/tugger
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: "^1.13.0"
- name: go test
run: |
cd cmd/tugger
go test . -cover -v
lint-test:
runs-on: ubuntu-latest
env:
IMAGE: jainishshah17/tugger
strategy:
fail-fast: false
matrix:
k8sVersion:
- v1.20.7
- v1.21.2
- v1.22.5
- v1.23.3
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Helm
uses: azure/setup-helm@v3.5
- name: Lint Chart
run: helm lint chart/* -f chart/*/ci/lint-values.yaml
- name: Build
run: docker build . -t $IMAGE
- name: Create kind cluster
uses: helm/kind-action@v1.8.0
with:
node_image: kindest/node:${{ matrix.k8sVersion }}
- name: Install
run: |
kind load docker-image $IMAGE --name=chart-testing
helm install $USER chart/tugger --debug --wait \
--set=createMutatingWebhook=true \
--set=image.tag=latest
- name: Test Mutation
timeout-minutes: 1
run: |
function test_jsonpath() {
until [ "$1" = "$(kubectl -n nginx get po -l test=tugger -o jsonpath="$2")" ]
do
echo "test failed \"$1\" = \"$2\""
sleep 1
done
}
kubectl apply -f test/nginx.yaml
test_jsonpath "jainishshah17/nginx" '{.items[0].spec.containers[0].image}'
test_jsonpath "original-secret" '{.items[0].spec.imagePullSecrets[0].name}'
test_jsonpath "regsecret" '{.items[0].spec.imagePullSecrets[1].name}'