Skip to content

Commit

Permalink
Merge pull request fluxcd-community#148 from russellyardley1/main
Browse files Browse the repository at this point in the history
Introduce support for specifying annotations for the pre-install-job
  • Loading branch information
stefanprodan authored Jan 18, 2023
2 parents 50b5a35 + 7ba4aa5 commit d9a2c41
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 9 deletions.
4 changes: 3 additions & 1 deletion charts/flux2/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
annotations:
artifacthub.io/changes: |
- "[Added]: Allow disabling CRD installation for specific controllers"
- "[Added]: Allow setting automountServiceAccountToken on the pod spec"
- "[Added]: Support specifying annotationts for the pre-install-job"
apiVersion: v2
appVersion: 0.37.0
description: A Helm chart for flux2
name: flux2
sources:
- https://github.com/fluxcd-community/helm-charts
type: application
version: 2.3.0
version: 2.4.0
3 changes: 2 additions & 1 deletion charts/flux2/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# flux2

![Version: 2.3.0](https://img.shields.io/badge/Version-2.3.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.37.0](https://img.shields.io/badge/AppVersion-0.37.0-informational?style=flat-square)
![Version: 2.4.0](https://img.shields.io/badge/Version-2.4.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.37.0](https://img.shields.io/badge/AppVersion-0.37.0-informational?style=flat-square)

A Helm chart for flux2

Expand All @@ -15,6 +15,7 @@ This helm chart is maintain and released by the fluxcd-community on a best effor
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| cli.affinity | object | `{}` | |
| cli.annotations | object | `{}` | |
| cli.image | string | `"ghcr.io/fluxcd/flux-cli"` | |
| cli.nodeSelector | object | `{}` | |
| cli.tag | string | `"v0.37.0"` | |
Expand Down
3 changes: 3 additions & 0 deletions charts/flux2/templates/pre-install-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ spec:
template:
metadata:
name: "{{ .Release.Name }}"
{{- with .Values.cli.annotations }}
annotations: {{ toYaml . | nindent 8 }}
{{- end }}
labels:
app.kubernetes.io/instance: {{ .Release.Namespace | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ should match snapshot of default values:
app.kubernetes.io/part-of: flux
app.kubernetes.io/version: 0.37.0
control-plane: controller
helm.sh/chart: flux2-2.3.0
helm.sh/chart: flux2-2.4.0
name: helm-controller
spec:
replicas: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ should match snapshot of default values:
app.kubernetes.io/part-of: flux
app.kubernetes.io/version: 0.37.0
control-plane: controller
helm.sh/chart: flux2-2.3.0
helm.sh/chart: flux2-2.4.0
name: image-automation-controller
spec:
replicas: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ should match snapshot of default values:
app.kubernetes.io/part-of: flux
app.kubernetes.io/version: 0.37.0
control-plane: controller
helm.sh/chart: flux2-2.3.0
helm.sh/chart: flux2-2.4.0
name: image-reflector-controller
spec:
replicas: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ should match snapshot of default values:
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/part-of: flux
app.kubernetes.io/version: 0.37.0
helm.sh/chart: flux2-2.3.0
helm.sh/chart: flux2-2.4.0
name: test1
namespace: NAMESPACE
type: Opaque
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ should match snapshot of default values:
app.kubernetes.io/part-of: flux
app.kubernetes.io/version: 0.37.0
control-plane: controller
helm.sh/chart: flux2-2.3.0
helm.sh/chart: flux2-2.4.0
name: kustomize-controller
spec:
replicas: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ should match snapshot of default values:
app.kubernetes.io/part-of: flux
app.kubernetes.io/version: 0.37.0
control-plane: controller
helm.sh/chart: flux2-2.3.0
helm.sh/chart: flux2-2.4.0
name: notification-controller
spec:
replicas: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ should match snapshot of default values:
app.kubernetes.io/part-of: flux
app.kubernetes.io/version: 0.37.0
control-plane: controller
helm.sh/chart: flux2-2.3.0
helm.sh/chart: flux2-2.4.0
name: source-controller
spec:
replicas: 1
Expand Down
36 changes: 36 additions & 0 deletions charts/flux2/tests/pre-install-job_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
suite: test pre-install-job hook
templates:
- pre-install-job.yaml
tests:
- it: should have no annotations added by default
asserts:
- isEmpty:
path: spec.template.metadata.annotations
- it: should have added annotation
set:
cli:
annotations:
name1: value1
asserts:
- isNotEmpty:
path: spec.template.metadata.annotations
- equal:
path: spec.template.metadata.annotations
value:
name1: value1
- it: should have added annotations
set:
cli:
annotations:
name1: value1
name2: value2
name3: value3
asserts:
- isNotEmpty:
path: spec.template.metadata.annotations
- equal:
path: spec.template.metadata.annotations
value:
name1: value1
name2: value2
name3: value3
1 change: 1 addition & 0 deletions charts/flux2/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ cli:
nodeSelector: {}
affinity: {}
tolerations: []
annotations: {}

# controllers

Expand Down

0 comments on commit d9a2c41

Please sign in to comment.