diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index 8e0228c..0590c38 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -19,6 +19,7 @@ spec: {{- end }} labels: {{- include "joy-generator.selectorLabels" . | nindent 8 }} + {{- if .Values.podLabels }}{{ toYaml .Values.podLabels | nindent 8 }}{{- end }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: diff --git a/chart/tests/with-additional-labels/expected.yaml b/chart/tests/with-additional-labels/expected.yaml new file mode 100644 index 0000000..cbc1639 --- /dev/null +++ b/chart/tests/with-additional-labels/expected.yaml @@ -0,0 +1,124 @@ +--- +# Source: joy-generator/templates/secret.yaml +apiVersion: v1 +kind: Secret +metadata: + name: my-release-joy-generator-config +stringData: + PLUGIN_TOKEN: '@very!l0ngands3curet0ken' +--- +# Source: joy-generator/templates/secret.yaml +apiVersion: v1 +kind: Secret +metadata: + name: my-release-joy-generator-github-app-key +stringData: + githubApp.pem: | + FOOBARLOREMISPUM +--- +# Source: joy-generator/templates/argocd-config.yaml +apiVersion: v1 +kind: ConfigMap +metadata: + name: my-release-joy-generator-config +data: + token: "$my-release-joy-generator-config:PLUGIN_TOKEN" + baseUrl: "http://my-release-joy-generator" +--- +# Source: joy-generator/templates/service.yaml +apiVersion: v1 +kind: Service +metadata: + name: my-release-joy-generator + labels: + helm.sh/chart: joy-generator-1.0.0 + app.kubernetes.io/name: joy-generator + app.kubernetes.io/instance: my-release + app.kubernetes.io/version: "1.0.0" + app.kubernetes.io/managed-by: Helm +spec: + type: ClusterIP + ports: + - port: 80 + targetPort: http + protocol: TCP + name: http + selector: + app.kubernetes.io/name: joy-generator + app.kubernetes.io/instance: my-release +--- +# Source: joy-generator/templates/deployment.yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + name: my-release-joy-generator + labels: + helm.sh/chart: joy-generator-1.0.0 + app.kubernetes.io/name: joy-generator + app.kubernetes.io/instance: my-release + app.kubernetes.io/version: "1.0.0" + app.kubernetes.io/managed-by: Helm +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: joy-generator + app.kubernetes.io/instance: my-release + template: + metadata: + labels: + app.kubernetes.io/name: joy-generator + app.kubernetes.io/instance: my-release + service-name: joy-generator-chart-test + spec: + securityContext: + {} + volumes: + - name: catalog-dir + emptyDir: {} + - name: github-app-private-key + secret: + secretName: my-release-joy-generator-github-app-key + containers: + - name: joy-generator + securityContext: + {} + image: "ghcr.io/nestoca/joy-generator:0.1.2" + imagePullPolicy: IfNotPresent + volumeMounts: + - mountPath: /tmp/catalog + name: catalog-dir + - mountPath: /etc/joy/config + name: github-app-private-key + env: + - name: CATALOG_DIR + value: "/tmp/catalog" + - name: CATALOG_URL + value: "https://github.com/example/foobar.git" + - name: GH_APP_ID + value: "123" + - name: GH_APP_INSTALLATION_ID + value: "666" + - name: GRACE_PERIOD + value: "10s" + - name: PORT + value: ":8080" + - name: GH_APP_PRIVATE_KEY_PATH + value: /etc/joy/config/githubApp.pem + envFrom: + - secretRef: + name: my-release-joy-generator-config + ports: + - name: http + containerPort: 8080 + protocol: TCP + livenessProbe: + httpGet: + path: /api/v1/health + port: http + readinessProbe: + httpGet: + path: /api/v1/readiness + port: http + resources: + {} diff --git a/chart/tests/with-additional-labels/values.yaml b/chart/tests/with-additional-labels/values.yaml new file mode 100644 index 0000000..f324a37 --- /dev/null +++ b/chart/tests/with-additional-labels/values.yaml @@ -0,0 +1,23 @@ +# Configuration settings for the joy-generator instance +env: + GH_APP_ID: "123" + GH_APP_INSTALLATION_ID: "666" + + # The HTTPS Git URL of your joy catalog + CATALOG_URL: "https://github.com/example/foobar.git" + +secretEnv: + values: + PLUGIN_TOKEN: "@very!l0ngands3curet0ken" + +# The GitHub app configuration. +# Required if githubToken is not set. +# The GitHub application private key (PEM format) +githubAppPrivateKey: | + FOOBARLOREMISPUM + +image: + tag: 0.1.2 + +podLabels: + service-name: joy-generator-chart-test