From 897f59b11f6a4d4f74c077c20a6ea43348cffdf6 Mon Sep 17 00:00:00 2001 From: Alastair Pitts Date: Tue, 17 Dec 2024 10:21:48 +1100 Subject: [PATCH 1/3] Fix script pod image pull policy env var (#358) --- .changeset/violet-paws-ring.md | 5 +++++ charts/kubernetes-agent/templates/_helpers.tpl | 8 ++++---- .../kubernetes-agent/templates/tentacle-deployment.yaml | 2 +- .../tentacle-deployment-container-env-vars_test.yaml | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 .changeset/violet-paws-ring.md diff --git a/.changeset/violet-paws-ring.md b/.changeset/violet-paws-ring.md new file mode 100644 index 00000000..924a9e21 --- /dev/null +++ b/.changeset/violet-paws-ring.md @@ -0,0 +1,5 @@ +--- +"kubernetes-agent": patch +--- + +Fix scriptPods.image.pullPolicy not working diff --git a/charts/kubernetes-agent/templates/_helpers.tpl b/charts/kubernetes-agent/templates/_helpers.tpl index c9cac486..aa0de4e3 100644 --- a/charts/kubernetes-agent/templates/_helpers.tpl +++ b/charts/kubernetes-agent/templates/_helpers.tpl @@ -151,15 +151,15 @@ The Env-var block required to set image name, tag and pullpolicy {{- define "kubernetes-agent.scriptPodEnvVars" -}} {{- if .repository }} - name: "OCTOPUS__K8STENTACLE__SCRIPTPODIMAGE" - value: {{ .repository | quote}} + value: {{ .repository | quote }} {{- end }} {{- if .tag }} - name: "OCTOPUS__K8STENTACLE__SCRIPTPODIMAGETAG" - value: {{ .tag | quote}} + value: {{ .tag | quote }} {{- end }} {{- if .pullPolicy }} -- name: "OCTOPUS__K8STENTACLE__SCRIPTPODIMAGEPULLPOLICY" - value: {{ .pullPolicy | quote}} +- name: "OCTOPUS__K8STENTACLE__SCRIPTPODPULLPOLICY" + value: {{ .pullPolicy | quote }} {{- end }} {{- end }} diff --git a/charts/kubernetes-agent/templates/tentacle-deployment.yaml b/charts/kubernetes-agent/templates/tentacle-deployment.yaml index b8743a1d..24efd38a 100644 --- a/charts/kubernetes-agent/templates/tentacle-deployment.yaml +++ b/charts/kubernetes-agent/templates/tentacle-deployment.yaml @@ -80,7 +80,7 @@ spec: - name: "OCTOPUS__K8STENTACLE__PODSERVICEACCOUNTNAME" value: {{ include "kubernetes-agent.scriptPodServiceAccountName" . | quote }} - name: "OCTOPUS__K8STENTACLE__PODVOLUMECLAIMNAME" - value: {{ (include "kubernetes-agent.pvcName" .) | quote}} + value: {{ (include "kubernetes-agent.pvcName" .) | quote }} - name: "OCTOPUS__K8STENTACLE__HELMRELEASENAME" value: {{ .Release.Name | quote}} - name: "OCTOPUS__K8STENTACLE__HELMCHARTVERSION" diff --git a/charts/kubernetes-agent/tests/tentacle-deployment-container-env-vars_test.yaml b/charts/kubernetes-agent/tests/tentacle-deployment-container-env-vars_test.yaml index d87b849a..2672f55f 100644 --- a/charts/kubernetes-agent/tests/tentacle-deployment-container-env-vars_test.yaml +++ b/charts/kubernetes-agent/tests/tentacle-deployment-container-env-vars_test.yaml @@ -374,7 +374,7 @@ tests: path: spec.template.spec.containers[0].env[?(@.name == 'OCTOPUS__K8STENTACLE__SCRIPTPODIMAGETAG')].value value: "1.0.0-deploymentTarget" - equal: - path: spec.template.spec.containers[0].env[?(@.name == 'OCTOPUS__K8STENTACLE__SCRIPTPODIMAGEPULLPOLICY')].value + path: spec.template.spec.containers[0].env[?(@.name == 'OCTOPUS__K8STENTACLE__SCRIPTPODPULLPOLICY')].value value: "Always" - it: "When running as a deployment Target, script pod image is not set by default" From d22cd82102b9336ada01c4680dee3b3f3fe2f721 Mon Sep 17 00:00:00 2001 From: Alastair Pitts Date: Tue, 17 Dec 2024 10:26:33 +1100 Subject: [PATCH 2/3] Update download-artifact and upload-artifact to v4 (#360) --- .github/workflows/kubernetes-agent-publish-chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/kubernetes-agent-publish-chart.yaml b/.github/workflows/kubernetes-agent-publish-chart.yaml index 4751bfeb..d963e7ea 100644 --- a/.github/workflows/kubernetes-agent-publish-chart.yaml +++ b/.github/workflows/kubernetes-agent-publish-chart.yaml @@ -105,7 +105,7 @@ jobs: - name: Package Chart run: helm package './charts/kubernetes-agent' --version '${{ steps.version.outputs.CHART_VERSION }}' - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 name: Upload packaged chart with: name: '${{ steps.version.outputs.PACKAGE_NAME }}' @@ -121,7 +121,7 @@ jobs: id-token: write # This is required to obtain an ID token from GitHub Actions for the job steps: - name: Download packaged chart - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: '${{ needs.version_and_package.outputs.PACKAGE_NAME }}' From ee1648c77bcbfb24ca24e5d9caec957282558f34 Mon Sep 17 00:00:00 2001 From: Octopus Build Agent Date: Tue, 17 Dec 2024 09:31:55 +1000 Subject: [PATCH 3/3] Version Kubernetes Agent Chart (#359) Co-authored-by: github-actions[bot] Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .changeset/violet-paws-ring.md | 5 ----- charts/kubernetes-agent/CHANGELOG.md | 6 ++++++ charts/kubernetes-agent/Chart.yaml | 2 +- charts/kubernetes-agent/README.md | 2 +- charts/kubernetes-agent/package.json | 2 +- .../auto-upgrader-serviceaccount_test.yaml.snap | 2 +- .../tests/__snapshot__/pod-serviceaccount_test.yaml.snap | 2 +- .../tests/__snapshot__/tentacle-deployment_test.yaml.snap | 6 +++--- .../tests/__snapshot__/tentacle-pvc_test.yaml.snap | 2 +- .../__snapshot__/tentacle-serviceaccount_test.yaml.snap | 2 +- 10 files changed, 16 insertions(+), 15 deletions(-) delete mode 100644 .changeset/violet-paws-ring.md diff --git a/.changeset/violet-paws-ring.md b/.changeset/violet-paws-ring.md deleted file mode 100644 index 924a9e21..00000000 --- a/.changeset/violet-paws-ring.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"kubernetes-agent": patch ---- - -Fix scriptPods.image.pullPolicy not working diff --git a/charts/kubernetes-agent/CHANGELOG.md b/charts/kubernetes-agent/CHANGELOG.md index 700816d7..035a400d 100644 --- a/charts/kubernetes-agent/CHANGELOG.md +++ b/charts/kubernetes-agent/CHANGELOG.md @@ -1,5 +1,11 @@ # kubernetes-agent +## 1.19.2 + +### Patch Changes + +- 897f59b: Fix scriptPods.image.pullPolicy not working + ## 1.19.1 ### Patch Changes diff --git a/charts/kubernetes-agent/Chart.yaml b/charts/kubernetes-agent/Chart.yaml index a8635232..1083df17 100644 --- a/charts/kubernetes-agent/Chart.yaml +++ b/charts/kubernetes-agent/Chart.yaml @@ -9,6 +9,6 @@ maintainers: email: "support@octopus.com" url: "https://octopus.com" type: application -version: "1.19.1" +version: "1.19.2" # This version number should be the same as the agent.image.tag value as this is the primary application version appVersion: "8.2.2514" diff --git a/charts/kubernetes-agent/README.md b/charts/kubernetes-agent/README.md index 384483eb..1273cc90 100644 --- a/charts/kubernetes-agent/README.md +++ b/charts/kubernetes-agent/README.md @@ -1,6 +1,6 @@ # kubernetes-agent -![Version: 1.19.1](https://img.shields.io/badge/Version-1.19.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 8.2.2514](https://img.shields.io/badge/AppVersion-8.2.2514-informational?style=flat-square) ![Octopus Deploy Version: 2024.2.6580+](https://img.shields.io/badge/Octopus_Deploy-2024.2.6580%2B-2F93E0?style=flat-square&logo=octopusdeploy&logoColor=%232F93E0&logoSize=auto) +![Version: 1.19.2](https://img.shields.io/badge/Version-1.19.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 8.2.2514](https://img.shields.io/badge/AppVersion-8.2.2514-informational?style=flat-square) ![Octopus Deploy Version: 2024.2.6580+](https://img.shields.io/badge/Octopus_Deploy-2024.2.6580%2B-2F93E0?style=flat-square&logo=octopusdeploy&logoColor=%232F93E0&logoSize=auto) A Helm chart for the Octopus Kubernetes Agent diff --git a/charts/kubernetes-agent/package.json b/charts/kubernetes-agent/package.json index 3bac77b3..d2d89783 100644 --- a/charts/kubernetes-agent/package.json +++ b/charts/kubernetes-agent/package.json @@ -1,6 +1,6 @@ { "name": "kubernetes-agent", - "version": "1.19.1", + "version": "1.19.2", "private": true, "description": "The Octopus Kubernetes Agent", "author": "Octopus Deploy Ptd Ltd", diff --git a/charts/kubernetes-agent/tests/__snapshot__/auto-upgrader-serviceaccount_test.yaml.snap b/charts/kubernetes-agent/tests/__snapshot__/auto-upgrader-serviceaccount_test.yaml.snap index 6bdc56c2..b0818fa8 100644 --- a/charts/kubernetes-agent/tests/__snapshot__/auto-upgrader-serviceaccount_test.yaml.snap +++ b/charts/kubernetes-agent/tests/__snapshot__/auto-upgrader-serviceaccount_test.yaml.snap @@ -9,6 +9,6 @@ should match snapshot: app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: octopus-agent app.kubernetes.io/version: 8.2.2514 - helm.sh/chart: kubernetes-agent-1.19.1 + helm.sh/chart: kubernetes-agent-1.19.2 name: octopus-agent-auto-upgrader namespace: NAMESPACE diff --git a/charts/kubernetes-agent/tests/__snapshot__/pod-serviceaccount_test.yaml.snap b/charts/kubernetes-agent/tests/__snapshot__/pod-serviceaccount_test.yaml.snap index 2728a420..dd88a02c 100644 --- a/charts/kubernetes-agent/tests/__snapshot__/pod-serviceaccount_test.yaml.snap +++ b/charts/kubernetes-agent/tests/__snapshot__/pod-serviceaccount_test.yaml.snap @@ -9,6 +9,6 @@ should match snapshot: app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: octopus-agent app.kubernetes.io/version: 8.2.2514 - helm.sh/chart: kubernetes-agent-1.19.1 + helm.sh/chart: kubernetes-agent-1.19.2 name: octopus-agent-scripts namespace: NAMESPACE diff --git a/charts/kubernetes-agent/tests/__snapshot__/tentacle-deployment_test.yaml.snap b/charts/kubernetes-agent/tests/__snapshot__/tentacle-deployment_test.yaml.snap index 6c509cf9..bf5810b0 100644 --- a/charts/kubernetes-agent/tests/__snapshot__/tentacle-deployment_test.yaml.snap +++ b/charts/kubernetes-agent/tests/__snapshot__/tentacle-deployment_test.yaml.snap @@ -8,7 +8,7 @@ should match snapshot: app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: octopus-agent app.kubernetes.io/version: 8.2.2514 - helm.sh/chart: kubernetes-agent-1.19.1 + helm.sh/chart: kubernetes-agent-1.19.2 name: octopus-agent-tentacle namespace: NAMESPACE spec: @@ -24,7 +24,7 @@ should match snapshot: app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: octopus-agent app.kubernetes.io/version: 8.2.2514 - helm.sh/chart: kubernetes-agent-1.19.1 + helm.sh/chart: kubernetes-agent-1.19.2 spec: affinity: nodeAffinity: @@ -77,7 +77,7 @@ should match snapshot: - name: OCTOPUS__K8STENTACLE__HELMRELEASENAME value: RELEASE-NAME - name: OCTOPUS__K8STENTACLE__HELMCHARTVERSION - value: 1.19.1 + value: 1.19.2 - name: OCTOPUS__K8STENTACLE__DISABLEAUTOPODCLEANUP value: "false" - name: OCTOPUS__K8STENTACLE__DISABLEPODEVENTSINTASKLOG diff --git a/charts/kubernetes-agent/tests/__snapshot__/tentacle-pvc_test.yaml.snap b/charts/kubernetes-agent/tests/__snapshot__/tentacle-pvc_test.yaml.snap index 5759f51c..91dc59f7 100644 --- a/charts/kubernetes-agent/tests/__snapshot__/tentacle-pvc_test.yaml.snap +++ b/charts/kubernetes-agent/tests/__snapshot__/tentacle-pvc_test.yaml.snap @@ -8,7 +8,7 @@ should match snapshot when storageClassName is set: app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: octopus-agent app.kubernetes.io/version: 8.2.2514 - helm.sh/chart: kubernetes-agent-1.19.1 + helm.sh/chart: kubernetes-agent-1.19.2 name: octopus-agent-RELEASE-NAME-pvc spec: accessModes: diff --git a/charts/kubernetes-agent/tests/__snapshot__/tentacle-serviceaccount_test.yaml.snap b/charts/kubernetes-agent/tests/__snapshot__/tentacle-serviceaccount_test.yaml.snap index a2efe1bb..13f0294f 100644 --- a/charts/kubernetes-agent/tests/__snapshot__/tentacle-serviceaccount_test.yaml.snap +++ b/charts/kubernetes-agent/tests/__snapshot__/tentacle-serviceaccount_test.yaml.snap @@ -9,6 +9,6 @@ should match snapshot: app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: octopus-agent app.kubernetes.io/version: 8.2.2514 - helm.sh/chart: kubernetes-agent-1.19.1 + helm.sh/chart: kubernetes-agent-1.19.2 name: octopus-agent-tentacle namespace: NAMESPACE