Skip to content

Commit

Permalink
Resolve issues with Helm chart deployment (#22)
Browse files Browse the repository at this point in the history
* validate helm chart on PR

* update Docker source image

* fix deployment values reference

* remove code generation validation

* use actions/setup-go@v4

* rollback go version to 1.19
  • Loading branch information
alehechka authored Apr 21, 2023
1 parent ff3538c commit 6cb620e
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 30 deletions.
31 changes: 12 additions & 19 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: actions/checkout@v3

- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: 1.19

Expand All @@ -40,29 +40,22 @@ jobs:
- name: Build Docker image
run: docker build -t kube-external-sync .

pr-generate:
name: Pull Request Generate Verification
validate-helm-charts:
name: Validate Helm Charts
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- name: Install helm
uses: Azure/setup-helm@v3

- name: Install controller-gen
run: go install sigs.k8s.io/controller-tools/cmd/controller-gen@latest
- name: Lint Helm Chart
run: helm lint deploy/helm/kube-external-sync

- name: Generate DeepCopy file
run: make generate
- name: Package Helm Chart
run: helm package deploy/helm/kube-external-sync

- name: Check diffs
run: |
if [[ `git status --porcelain` ]]; then
echo "Changes"
exit 1
else
echo "No Changes"
fi
- name: Template Helm Chart
run: helm template helm-charts deploy/helm/kube-external-sync
8 changes: 3 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ jobs:
id: image
run: |
if [ "${{ github.ref_type }}" = "tag" ]; then
echo "::set-output name=tag::${{ github.ref_name }}"
echo "tag=${{ github.ref_name }}" >> $GITHUB_OUTPUT
else
echo "::set-output name=tag::latest"
echo "name=tag=latest" >> $GITHUB_OUTPUT
fi
- uses: docker/build-push-action@v3
Expand All @@ -58,15 +58,13 @@ jobs:

- name: Setup Helm
uses: azure/setup-helm@v3
with:
version: 'v3.9.4'

- name: Get Chart version
id: chart
run: |
VERSION=${{ github.ref_name }}
echo "::set-output name=version::${VERSION##*v}"
echo "version=${VERSION##*v}" >> $GITHUB_OUTPUT
- name: Update versions
run: |
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# BUILD SERVER

FROM golang:1.19-alpine as go-builder
FROM golang:1.20-alpine as go-builder

WORKDIR /app

Expand Down
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,3 @@ start:
--enable-traefik \
--pod-namespace kube-external-sync \
--default-ingress-hostname "*.example.com"

generate:
controller-gen object paths=./...
4 changes: 2 additions & 2 deletions deploy/helm/kube-external-sync/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ spec:
fieldRef:
fieldPath: metadata.namespace
- name: LOG_LEVEL
value: {{ .Values.deployment.env.LOG_LEVEL }}
value: {{ .Values.deployment.config.LOG_LEVEL }}
- name: LOG_FORMAT
value: {{ .Values.deployment.env.LOG_FORMAT }}
value: {{ .Values.deployment.config.LOG_FORMAT }}
- name: LIVENESS_PORT
value: {{ .Values.deployment.port | quote }}
- name: RESYNC_PERIOD
Expand Down

0 comments on commit 6cb620e

Please sign in to comment.