diff --git a/packages/system/capi-operator/charts/cluster-api-operator/Chart.yaml b/packages/system/capi-operator/charts/cluster-api-operator/Chart.yaml index c92910f0..5108c7dc 100644 --- a/packages/system/capi-operator/charts/cluster-api-operator/Chart.yaml +++ b/packages/system/capi-operator/charts/cluster-api-operator/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 -appVersion: 0.17.0 +appVersion: 0.18.1 description: Cluster API Operator name: cluster-api-operator type: application -version: 0.17.0 +version: 0.18.1 diff --git a/packages/system/capi-operator/charts/cluster-api-operator/templates/addon.yaml b/packages/system/capi-operator/charts/cluster-api-operator/templates/addon.yaml index c571b60a..a2eb8fb9 100644 --- a/packages/system/capi-operator/charts/cluster-api-operator/templates/addon.yaml +++ b/packages/system/capi-operator/charts/cluster-api-operator/templates/addon.yaml @@ -26,8 +26,10 @@ apiVersion: v1 kind: Namespace metadata: annotations: + {{- if $.Values.enableHelmHook }} "helm.sh/hook": "post-install,post-upgrade" "helm.sh/hook-weight": "1" + {{- end }} "argocd.argoproj.io/sync-wave": "1" name: {{ $addonNamespace }} --- @@ -37,8 +39,10 @@ metadata: name: {{ $addonName }} namespace: {{ $addonNamespace }} annotations: + {{- if $.Values.enableHelmHook }} "helm.sh/hook": "post-install,post-upgrade" "helm.sh/hook-weight": "2" + {{- end }} "argocd.argoproj.io/sync-wave": "2" {{- if or $addonVersion $.Values.secretName }} spec: diff --git a/packages/system/capi-operator/charts/cluster-api-operator/templates/bootstrap.yaml b/packages/system/capi-operator/charts/cluster-api-operator/templates/bootstrap.yaml index 69a930f2..ed5d7924 100644 --- a/packages/system/capi-operator/charts/cluster-api-operator/templates/bootstrap.yaml +++ b/packages/system/capi-operator/charts/cluster-api-operator/templates/bootstrap.yaml @@ -26,8 +26,11 @@ apiVersion: v1 kind: Namespace metadata: annotations: + {{- if $.Values.enableHelmHook }} "helm.sh/hook": "post-install,post-upgrade" "helm.sh/hook-weight": "1" + {{- end }} + "argocd.argoproj.io/sync-wave": "1" name: {{ $bootstrapNamespace }} --- apiVersion: operator.cluster.x-k8s.io/v1alpha2 @@ -36,8 +39,11 @@ metadata: name: {{ $bootstrapName }} namespace: {{ $bootstrapNamespace }} annotations: + {{- if $.Values.enableHelmHook }} "helm.sh/hook": "post-install,post-upgrade" "helm.sh/hook-weight": "2" + {{- end }} + "argocd.argoproj.io/sync-wave": "2" {{- if or $bootstrapVersion $.Values.configSecret.name }} spec: {{- end}} diff --git a/packages/system/capi-operator/charts/cluster-api-operator/templates/control-plane.yaml b/packages/system/capi-operator/charts/cluster-api-operator/templates/control-plane.yaml index 40bda081..d72249d1 100644 --- a/packages/system/capi-operator/charts/cluster-api-operator/templates/control-plane.yaml +++ b/packages/system/capi-operator/charts/cluster-api-operator/templates/control-plane.yaml @@ -26,8 +26,11 @@ apiVersion: v1 kind: Namespace metadata: annotations: + {{- if $.Values.enableHelmHook }} "helm.sh/hook": "post-install,post-upgrade" "helm.sh/hook-weight": "1" + {{- end }} + "argocd.argoproj.io/sync-wave": "1" name: {{ $controlPlaneNamespace }} --- apiVersion: operator.cluster.x-k8s.io/v1alpha2 @@ -36,8 +39,11 @@ metadata: name: {{ $controlPlaneName }} namespace: {{ $controlPlaneNamespace }} annotations: + {{- if $.Values.enableHelmHook }} "helm.sh/hook": "post-install,post-upgrade" "helm.sh/hook-weight": "2" + {{- end }} + "argocd.argoproj.io/sync-wave": "2" {{- if or $controlPlaneVersion $.Values.configSecret.name $.Values.manager }} spec: {{- end}} diff --git a/packages/system/capi-operator/charts/cluster-api-operator/templates/core-conditions.yaml b/packages/system/capi-operator/charts/cluster-api-operator/templates/core-conditions.yaml index bb396a24..059c8c7d 100644 --- a/packages/system/capi-operator/charts/cluster-api-operator/templates/core-conditions.yaml +++ b/packages/system/capi-operator/charts/cluster-api-operator/templates/core-conditions.yaml @@ -1,4 +1,4 @@ -{{- if or .Values.addon .Values.bootstrap .Values.controlPlane .Values.infrastructure }} +{{- if or .Values.addon .Values.bootstrap .Values.controlPlane .Values.infrastructure .Values.ipam }} # Deploy core components if not specified {{- if not .Values.core }} --- @@ -6,8 +6,11 @@ apiVersion: v1 kind: Namespace metadata: annotations: + {{- if $.Values.enableHelmHook }} "helm.sh/hook": "post-install,post-upgrade" "helm.sh/hook-weight": "1" + {{- end }} + "argocd.argoproj.io/sync-wave": "1" name: capi-system --- apiVersion: operator.cluster.x-k8s.io/v1alpha2 @@ -16,8 +19,11 @@ metadata: name: cluster-api namespace: capi-system annotations: + {{- if $.Values.enableHelmHook }} "helm.sh/hook": "post-install,post-upgrade" "helm.sh/hook-weight": "2" + {{- end }} + "argocd.argoproj.io/sync-wave": "2" {{- with .Values.configSecret }} spec: configSecret: @@ -28,4 +34,3 @@ spec: {{- end }} {{- end }} {{- end }} - diff --git a/packages/system/capi-operator/charts/cluster-api-operator/templates/core.yaml b/packages/system/capi-operator/charts/cluster-api-operator/templates/core.yaml index 8f993496..828d2269 100644 --- a/packages/system/capi-operator/charts/cluster-api-operator/templates/core.yaml +++ b/packages/system/capi-operator/charts/cluster-api-operator/templates/core.yaml @@ -25,8 +25,11 @@ apiVersion: v1 kind: Namespace metadata: annotations: + {{- if $.Values.enableHelmHook }} "helm.sh/hook": "post-install,post-upgrade" "helm.sh/hook-weight": "1" + {{- end }} + "argocd.argoproj.io/sync-wave": "1" name: {{ $coreNamespace }} --- apiVersion: operator.cluster.x-k8s.io/v1alpha2 @@ -35,8 +38,10 @@ metadata: name: {{ $coreName }} namespace: {{ $coreNamespace }} annotations: + {{- if $.Values.enableHelmHook }} "helm.sh/hook": "post-install,post-upgrade" "helm.sh/hook-weight": "2" + {{- end }} "argocd.argoproj.io/sync-wave": "2" {{- if or $coreVersion $.Values.configSecret.name $.Values.manager }} spec: @@ -45,8 +50,8 @@ spec: version: {{ $coreVersion }} {{- end }} {{- if $.Values.manager }} - manager: {{- if and $.Values.manager.featureGates $.Values.manager.featureGates.core }} + manager: featureGates: {{- range $key, $value := $.Values.manager.featureGates.core }} {{ $key }}: {{ $value }} diff --git a/packages/system/capi-operator/charts/cluster-api-operator/templates/infra-conditions.yaml b/packages/system/capi-operator/charts/cluster-api-operator/templates/infra-conditions.yaml index a311684e..d2c2c217 100644 --- a/packages/system/capi-operator/charts/cluster-api-operator/templates/infra-conditions.yaml +++ b/packages/system/capi-operator/charts/cluster-api-operator/templates/infra-conditions.yaml @@ -7,8 +7,10 @@ apiVersion: v1 kind: Namespace metadata: annotations: + {{- if $.Values.enableHelmHook }} "helm.sh/hook": "post-install,post-upgrade" "helm.sh/hook-weight": "1" + {{- end }} "argocd.argoproj.io/sync-wave": "1" name: capi-kubeadm-bootstrap-system --- @@ -18,8 +20,10 @@ metadata: name: kubeadm namespace: capi-kubeadm-bootstrap-system annotations: + {{- if $.Values.enableHelmHook }} "helm.sh/hook": "post-install,post-upgrade" "helm.sh/hook-weight": "2" + {{- end }} "argocd.argoproj.io/sync-wave": "2" {{- with .Values.configSecret }} spec: @@ -37,8 +41,10 @@ apiVersion: v1 kind: Namespace metadata: annotations: + {{- if $.Values.enableHelmHook }} "helm.sh/hook": "post-install,post-upgrade" "helm.sh/hook-weight": "1" + {{- end }} "argocd.argoproj.io/sync-wave": "1" name: capi-kubeadm-control-plane-system --- @@ -48,14 +54,16 @@ metadata: name: kubeadm namespace: capi-kubeadm-control-plane-system annotations: + {{- if $.Values.enableHelmHook }} "helm.sh/hook": "post-install,post-upgrade" "helm.sh/hook-weight": "2" + {{- end }} "argocd.argoproj.io/sync-wave": "2" {{- with .Values.configSecret }} spec: {{- if $.Values.manager }} - manager: {{- if and $.Values.manager.featureGates $.Values.manager.featureGates.kubeadm }} + manager: featureGates: {{- range $key, $value := $.Values.manager.featureGates.kubeadm }} {{ $key }}: {{ $value }} diff --git a/packages/system/capi-operator/charts/cluster-api-operator/templates/infra.yaml b/packages/system/capi-operator/charts/cluster-api-operator/templates/infra.yaml index 9d504659..5841336c 100644 --- a/packages/system/capi-operator/charts/cluster-api-operator/templates/infra.yaml +++ b/packages/system/capi-operator/charts/cluster-api-operator/templates/infra.yaml @@ -26,8 +26,10 @@ apiVersion: v1 kind: Namespace metadata: annotations: + {{- if $.Values.enableHelmHook }} "helm.sh/hook": "post-install,post-upgrade" "helm.sh/hook-weight": "1" + {{- end }} "argocd.argoproj.io/sync-wave": "1" name: {{ $infrastructureNamespace }} --- @@ -37,8 +39,10 @@ metadata: name: {{ $infrastructureName }} namespace: {{ $infrastructureNamespace }} annotations: + {{- if $.Values.enableHelmHook }} "helm.sh/hook": "post-install,post-upgrade" "helm.sh/hook-weight": "2" + {{- end }} "argocd.argoproj.io/sync-wave": "2" {{- if or $infrastructureVersion $.Values.configSecret.name $.Values.manager $.Values.additionalDeployments }} spec: @@ -47,8 +51,8 @@ spec: version: {{ $infrastructureVersion }} {{- end }} {{- if $.Values.manager }} - manager: {{- if and (kindIs "map" $.Values.manager.featureGates) (hasKey $.Values.manager.featureGates $infrastructureName) }} + manager: {{- range $key, $value := $.Values.manager.featureGates }} {{- if eq $key $infrastructureName }} featureGates: diff --git a/packages/system/capi-operator/charts/cluster-api-operator/templates/ipam.yaml b/packages/system/capi-operator/charts/cluster-api-operator/templates/ipam.yaml index f64a0da8..06960afb 100644 --- a/packages/system/capi-operator/charts/cluster-api-operator/templates/ipam.yaml +++ b/packages/system/capi-operator/charts/cluster-api-operator/templates/ipam.yaml @@ -26,8 +26,10 @@ apiVersion: v1 kind: Namespace metadata: annotations: + {{- if $.Values.enableHelmHook }} "helm.sh/hook": "post-install,post-upgrade" "helm.sh/hook-weight": "1" + {{- end }} "argocd.argoproj.io/sync-wave": "1" name: {{ $ipamNamespace }} --- @@ -37,8 +39,10 @@ metadata: name: {{ $ipamName }} namespace: {{ $ipamNamespace }} annotations: + {{- if $.Values.enableHelmHook }} "helm.sh/hook": "post-install,post-upgrade" "helm.sh/hook-weight": "2" + {{- end }} "argocd.argoproj.io/sync-wave": "2" {{- if or $ipamVersion $.Values.configSecret.name $.Values.manager $.Values.additionalDeployments }} spec: @@ -47,8 +51,8 @@ spec: version: {{ $ipamVersion }} {{- end }} {{- if $.Values.manager }} - manager: {{- if and (kindIs "map" $.Values.manager.featureGates) (hasKey $.Values.manager.featureGates $ipamName) }} + manager: {{- range $key, $value := $.Values.manager.featureGates }} {{- if eq $key $ipamName }} featureGates: diff --git a/packages/system/capi-operator/charts/cluster-api-operator/values.yaml b/packages/system/capi-operator/charts/cluster-api-operator/values.yaml index 080378fd..12507a3c 100644 --- a/packages/system/capi-operator/charts/cluster-api-operator/values.yaml +++ b/packages/system/capi-operator/charts/cluster-api-operator/values.yaml @@ -21,7 +21,7 @@ leaderElection: image: manager: repository: registry.k8s.io/capi-operator/cluster-api-operator - tag: v0.17.0 + tag: v0.18.1 pullPolicy: IfNotPresent env: manager: [] @@ -69,3 +69,4 @@ volumeMounts: - mountPath: /tmp/k8s-webhook-server/serving-certs name: cert readOnly: true +enableHelmHook: true