From a3dbb4282009c5d920370a8ff10edccfba074a43 Mon Sep 17 00:00:00 2001 From: Stefan Prodan Date: Thu, 9 Jan 2025 19:10:03 +0200 Subject: [PATCH] flux-instance: Add `commonMetadata` and `sync.name` to values Signed-off-by: Stefan Prodan --- charts/flux-instance/README.md | 3 ++- charts/flux-instance/templates/instance.yaml | 14 ++++++++++++++ charts/flux-instance/values.schema.json | 16 ++++++++++++++++ charts/flux-instance/values.yaml | 5 +++++ 4 files changed, 37 insertions(+), 1 deletion(-) diff --git a/charts/flux-instance/README.md b/charts/flux-instance/README.md index fa5896e..0cc3b2f 100644 --- a/charts/flux-instance/README.md +++ b/charts/flux-instance/README.md @@ -38,12 +38,13 @@ helm -n flux-system uninstall flux | commonLabels | object | `{}` | Common labels to add to all deployed objects including pods. | | fullnameOverride | string | `"flux"` | | | instance.cluster | object | `{"domain":"cluster.local","multitenant":false,"networkPolicy":true,"tenantDefaultServiceAccount":"default","type":"kubernetes"}` | Cluster https://fluxcd.control-plane.io/operator/fluxinstance/#cluster-configuration | +| instance.commonMetadata | object | `{"annotations":{},"labels":{}}` | Common metadata https://fluxcd.control-plane.io/operator/fluxinstance/#common-metadata | | instance.components | list | `["source-controller","kustomize-controller","helm-controller","notification-controller"]` | Components https://fluxcd.control-plane.io/operator/fluxinstance/#components-configuration | | instance.distribution | object | `{"artifact":"oci://ghcr.io/controlplaneio-fluxcd/flux-operator-manifests:latest","imagePullSecret":"","registry":"ghcr.io/fluxcd","version":"2.x"}` | Distribution https://fluxcd.control-plane.io/operator/fluxinstance/#distribution-configuration | | instance.kustomize.patches | list | `[]` | Kustomize patches https://fluxcd.control-plane.io/operator/fluxinstance/#kustomize-patches | | instance.sharding | object | `{"key":"sharding.fluxcd.io/key","shards":[]}` | Sharding https://fluxcd.control-plane.io/operator/fluxinstance/#sharding-configuration | | instance.storage | object | `{"class":"","size":""}` | Storage https://fluxcd.control-plane.io/operator/fluxinstance/#storage-configuration | -| instance.sync | object | `{"kind":"GitRepository","path":"","pullSecret":"","ref":"","url":""}` | Sync https://fluxcd.control-plane.io/operator/fluxinstance/#sync-configuration | +| instance.sync | object | `{"kind":"GitRepository","name":"","path":"","pullSecret":"","ref":"","url":""}` | Sync https://fluxcd.control-plane.io/operator/fluxinstance/#sync-configuration | | nameOverride | string | `""` | | ## Source Code diff --git a/charts/flux-instance/templates/instance.yaml b/charts/flux-instance/templates/instance.yaml index ebcd062..a9ac136 100644 --- a/charts/flux-instance/templates/instance.yaml +++ b/charts/flux-instance/templates/instance.yaml @@ -22,6 +22,17 @@ spec: {{- end }} components: {{ .Values.instance.components | toYaml | nindent 4 }} cluster: {{ .Values.instance.cluster | toYaml | nindent 4 }} + {{- if or .Values.instance.commonMetadata.annotations .Values.instance.commonMetadata.labels }} + commonMetadata: + {{- with .Values.instance.commonMetadata.annotations }} + annotations: + {{- toYaml . | nindent 6 }} + {{- end }} + {{- with .Values.instance.commonMetadata.labels }} + labels: + {{- toYaml . | nindent 6 }} + {{- end }} + {{- end }} kustomize: {{ .Values.instance.kustomize | toYaml | nindent 4 }} {{- if .Values.instance.sync.url }} sync: @@ -29,6 +40,9 @@ spec: url: {{ .Values.instance.sync.url }} ref: {{ .Values.instance.sync.ref }} path: {{ .Values.instance.sync.path }} + {{- if .Values.instance.sync.name }} + name: {{ .Values.instance.sync.name }} + {{- end }} {{- if .Values.instance.sync.pullSecret }} pullSecret: {{ .Values.instance.sync.pullSecret }} {{- end }} diff --git a/charts/flux-instance/values.schema.json b/charts/flux-instance/values.schema.json index a3cd648..6937558 100644 --- a/charts/flux-instance/values.schema.json +++ b/charts/flux-instance/values.schema.json @@ -41,6 +41,19 @@ }, "type": "object" }, + "commonMetadata": { + "properties": { + "annotations": { + "properties": {}, + "type": "object" + }, + "labels": { + "properties": {}, + "type": "object" + } + }, + "type": "object" + }, "components": { "items": { "enum": [ @@ -123,6 +136,9 @@ ], "type": "string" }, + "name": { + "type": "string" + }, "path": { "type": "string" }, diff --git a/charts/flux-instance/values.yaml b/charts/flux-instance/values.yaml index c6426a1..69108c3 100644 --- a/charts/flux-instance/values.yaml +++ b/charts/flux-instance/values.yaml @@ -23,6 +23,10 @@ instance: networkPolicy: true multitenant: false tenantDefaultServiceAccount: "default" + # -- Common metadata https://fluxcd.control-plane.io/operator/fluxinstance/#common-metadata + commonMetadata: # @schema required: false + labels: { } + annotations: { } # -- Storage https://fluxcd.control-plane.io/operator/fluxinstance/#storage-configuration storage: # @schema required: false class: "" @@ -38,6 +42,7 @@ instance: ref: "" path: "" pullSecret: "" + name: "" kustomize: # @schema required: false # -- Kustomize patches https://fluxcd.control-plane.io/operator/fluxinstance/#kustomize-patches patches: [] # @schema item: object