Skip to content

Commit

Permalink
Merge branch 'main' into chart_release
Browse files Browse the repository at this point in the history
  • Loading branch information
cyclinder authored Oct 29, 2023
2 parents fc9e036 + 3045839 commit fb86f38
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 47 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/call-image-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
push: false
provenance: false
platforms: linux/amd64
type: docker,dest=/tmp/image.tar
outputs: type=docker,dest=/tmp/image.tar
github-token: ${{ secrets.GITHUB_TOKEN }}
tags: |
${{ env.ONLINE_REGISTER }}/${{ github.repository }}:${{ inputs.tag }}
Expand All @@ -107,5 +107,5 @@ jobs:
uses: actions/upload-artifact@v3.1.3
with:
name: image-e2e-tar
path: /tmp/images.tar
path: /tmp/image.tar
retention-days: 1
58 changes: 15 additions & 43 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ jobs:
exit 1
fi
call-build-main:
call-build-image:
uses: ./.github/workflows/call-image-build.yaml
if: ${{ github.event_name == 'push' }}
needs: [get_ref]
with:
ref: ${{ github.ref }}
tag: ${{ github.sha }}
push: false
ci: true
ref: ${{ github.ref }}
tag: ${{ needs.get_ref.outputs.tag }}
push: false
ci: true
secrets: inherit

call_e2e:
Expand All @@ -52,6 +52,7 @@ jobs:
uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: "0"
ref: ${{ github.ref }}

- name: Setup Golang
Expand All @@ -75,50 +76,21 @@ jobs:

- name: Load Image to docker
run: |
docker load -i .tmp/images.tar
docker load -i .tmp/image.tar
docker images
# https://github.com/actions/setup-python
- name: Set up Python
uses: actions/setup-python@v4.7.0
with:
python-version: 3.8
architecture: x64

# https://github.com/helm/chart-testing-action
# Pre-requisites: A GitHub repo containing a directory with your Helm charts (e.g: charts)
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.4.0
with:
# CT version
version: v3.9.0

- name: Run chart-testing (list-changed)
id: list-changed
run: |
# https://github.com/helm/chart-testing-action/issues/25
# if the default branch is not master , the CLI exits with error
changed=$( ct list-changed --target-branch ${{ github.ref }} )
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
# version checking, YAML schema validation on 'Chart.yaml', YAML linting on 'Chart.yaml'
# and 'values.yaml', and maintainer validation
- name: Run chart-testing (lint)
run: ct lint --debug --target-branch=${{ github.ref }} --check-version-increment=false

# https://github.com/helm/kind-action
- name: Create Kind cluster
if: steps.list-changed.outputs.changed == 'true'
uses: helm/kind-action@v1.8.0
with:
wait: 120s

# It automatically detects charts changed
- name: Run chart-testing (install)
if: steps.list-changed.outputs.changed == 'true'
run: |
kind load docker-image ${{ env.ONLINE_REGISTER }}/${{ github.repository }}:${{ github.event.pull_request.head.sha }}
ct install --debug --target-branch ${{ github.ref }} --namespace kube-system \
--helm-extra-args "--timeout 400s --cilium.image.tag=${{ github.event.pull_request.head.sha }}"
kind load docker-image ${{ env.ONLINE_REGISTER }}/${{ github.repository }}:${{ needs.get_ref.outputs.tag }} --name chart-testing
helm upgrade --install cilium-chaining -n kube-system charts/cilium-chaining \
--set cilium.image.tag=${{ needs.get_ref.outputs.tag }}
sleep 20
kubectl get po -n kube-system -o wide
kubectl describe po -n kube-system -l app.kubernetes.io/name=cilium-chaining
kubectl wait --for=condition=ready -l app.kubernetes.io/name=cilium-chaining --timeout=300s pod -n kube-system
2 changes: 1 addition & 1 deletion charts/cilium-chaining/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ spec:
{{- end }}
containers:
- command:
- /bin/init.sh
- ./init.sh
env:
- name: NODENAME
valueFrom:
Expand Down
2 changes: 1 addition & 1 deletion manifests/cilium-chaining.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ spec:
- linux
containers:
- command:
- /bin/init.sh
- ./init.sh
env:
- name: NODENAME
valueFrom:
Expand Down

0 comments on commit fb86f38

Please sign in to comment.