From a4f6235b608922f414a0b517a512c6f0397dbd57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9mence=20Lesn=C3=A9?= Date: Wed, 22 Nov 2023 18:34:48 +0100 Subject: [PATCH] Feat: Add "extraManifests" template Feat: Condition the requirement of the organizationURL parameter to the creation of the provided k8s secret Fix: Remove template from extraManifests generation Quality: Code quality Fix: Helm syntax --- src/helm/azure-pipelines-agent/templates/NOTES.txt | 4 ++++ .../templates/extra-manifests.yaml | 4 ++++ src/helm/azure-pipelines-agent/values.yaml | 13 +++++++++++++ 3 files changed, 21 insertions(+) create mode 100644 src/helm/azure-pipelines-agent/templates/extra-manifests.yaml diff --git a/src/helm/azure-pipelines-agent/templates/NOTES.txt b/src/helm/azure-pipelines-agent/templates/NOTES.txt index fb695a46..e392b2c9 100644 --- a/src/helm/azure-pipelines-agent/templates/NOTES.txt +++ b/src/helm/azure-pipelines-agent/templates/NOTES.txt @@ -1,4 +1,8 @@ +{{- if (.Values.secret.create) -}} Check your Azure DevOps portal at to manage the Azure Pipelines Agent ({{ .Values.pipelines.organizationURL | quote | required "A value for .Values.pipelines.organizationURL is required" }}/_settings/agentpools). +{{- else -}} +Secret creation disabled, remember to create/update the secret {{ include "azure-pipelines-agent.secretName" . | quote }} and that the fields personalAccessToken and organizationURL are required +{{- end -}} {{- if and (.Values.autoscaling.enabled) (.Capabilities.APIVersions.Has "keda.sh/v1alpha1") -}} Your cluster is KEDA enabled, your pipelines agents will scale based on your usage. When you won't use them, they will be automatically removed. diff --git a/src/helm/azure-pipelines-agent/templates/extra-manifests.yaml b/src/helm/azure-pipelines-agent/templates/extra-manifests.yaml new file mode 100644 index 00000000..a9b7ff14 --- /dev/null +++ b/src/helm/azure-pipelines-agent/templates/extra-manifests.yaml @@ -0,0 +1,4 @@ +{{ range .Values.extraManifests }} +{{- toYaml . }} +--- +{{ end }} diff --git a/src/helm/azure-pipelines-agent/values.yaml b/src/helm/azure-pipelines-agent/values.yaml index 9f00df08..f94d5dcb 100644 --- a/src/helm/azure-pipelines-agent/values.yaml +++ b/src/helm/azure-pipelines-agent/values.yaml @@ -131,3 +131,16 @@ extraVolumeMounts: [] # image: busybox # command: ["/bin/sh", "-c", "echo Hello World"] initContainers: [] + +## Extra manifests to deploy as an array +extraManifests: + [] + + # - apiVersion: v1 + # kind: Secret + # metadata: + # labels: + # name: azure-pipeline-secret + # data: + # personalAccessToken: "value" + # organizationURL: "value"