Skip to content

Commit 9377f55

Browse files
authored
Downgrade CAPI operator (#942)
Resolves #940.
2 parents 2c6338a + d002879 commit 9377f55

12 files changed

Lines changed: 188 additions & 428 deletions

File tree

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
export NAME=capi-operator
22
export NAMESPACE=cozy-cluster-api
3+
export REPO_NAME=capi-operator
4+
export REPO_URL=https://kubernetes-sigs.github.io/cluster-api-operator
5+
export CHART_NAME=cluster-api-operator
6+
export CHART_VERSION=^0.18
37

48
include ../../../scripts/package.mk
59

6-
update:
7-
rm -rf charts
8-
helm repo add capi-operator https://kubernetes-sigs.github.io/cluster-api-operator
9-
helm repo update capi-operator
10-
helm pull capi-operator/cluster-api-operator --untar --untardir charts
11-
rm -rf charts/cluster-api-operator/charts
10+
update: clean capi-operator-update
11+
rm -rf charts/cluster-api-operator/charts/
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v2
2-
appVersion: 0.19.0
2+
appVersion: 0.18.1
33
description: Cluster API Operator
44
name: cluster-api-operator
55
type: application
6-
version: 0.19.0
6+
version: 0.18.1

‎packages/system/capi-operator/charts/cluster-api-operator/templates/addon.yaml‎

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,26 @@
11
# Addon provider
2-
{{- range $name, $addon := $.Values.addon }}
3-
{{- $addonNamespace := default ( printf "%s-%s" $name "addon-system" ) (get $addon "namespace") }}
4-
{{- $addonName := $name }}
5-
{{- $addonVersion := get $addon "version" }}
2+
{{- if .Values.addon }}
3+
{{- $addons := split ";" .Values.addon }}
4+
{{- $addonNamespace := "" }}
5+
{{- $addonName := "" }}
6+
{{- $addonVersion := "" }}
7+
{{- range $addon := $addons }}
8+
{{- $addonArgs := split ":" $addon }}
9+
{{- $addonArgsLen := len $addonArgs }}
10+
{{- if eq $addonArgsLen 3 }}
11+
{{- $addonNamespace = $addonArgs._0 }}
12+
{{- $addonName = $addonArgs._1 }}
13+
{{- $addonVersion = $addonArgs._2 }}
14+
{{- else if eq $addonArgsLen 2 }}
15+
{{- $addonNamespace = print $addonArgs._0 "-addon-system" }}
16+
{{- $addonName = $addonArgs._0 }}
17+
{{- $addonVersion = $addonArgs._1 }}
18+
{{- else if eq $addonArgsLen 1 }}
19+
{{- $addonNamespace = print $addonArgs._0 "-addon-system" }}
20+
{{- $addonName = $addonArgs._0 }}
21+
{{- else }}
22+
{{- fail "addon provider argument should have the following format helm:v1.0.0 or mynamespace:helm:v1.0.0" }}
23+
{{- end }}
624
---
725
apiVersion: v1
826
kind: Namespace
@@ -38,24 +56,5 @@ spec:
3856
{{- if $.Values.secretNamespace }}
3957
secretNamespace: {{ $.Values.secretNamespace }}
4058
{{- end }}
41-
{{- if $addon.manifestPatches }}
42-
manifestPatches: {{ toYaml $addon.manifestPatches | nindent 4 }}
43-
{{- end }}
44-
{{- if $addon.additionalManifests }}
45-
additionalManifests:
46-
name: {{ $addon.additionalManifests.name }}
47-
{{- if $addon.additionalManifests.namespace }}
48-
namespace: {{ $addon.additionalManifests.namespace }}
49-
{{- end }} {{/* if $addon.additionalManifests.namespace */}}
5059
{{- end }}
51-
{{- if $addon.additionalManifests }}
52-
---
53-
apiVersion: v1
54-
kind: ConfigMap
55-
metadata:
56-
name: {{ $addon.additionalManifests.name }}
57-
namespace: {{ default $addonNamespace $addon.additionalManifests.namespace }}
58-
data:
59-
manifests: {{- toYaml $addon.additionalManifests.manifests | nindent 4 }}
6060
{{- end }}
61-
{{- end }} {{/* range $name, $addon := .Values.addon */}}

‎packages/system/capi-operator/charts/cluster-api-operator/templates/bootstrap.yaml‎

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,26 @@
11
# Bootstrap provider
2-
{{- range $name, $bootstrap := $.Values.bootstrap }}
3-
{{- $bootstrapNamespace := default ( printf "%s-%s" $name "bootstrap-system" ) (get $bootstrap "namespace") }}
4-
{{- $bootstrapName := $name }}
5-
{{- $bootstrapVersion := get $bootstrap "version" }}
2+
{{- if .Values.bootstrap }}
3+
{{- $bootstraps := split ";" .Values.bootstrap }}
4+
{{- $bootstrapNamespace := "" }}
5+
{{- $bootstrapName := "" }}
6+
{{- $bootstrapVersion := "" }}
7+
{{- range $bootstrap := $bootstraps }}
8+
{{- $bootstrapArgs := split ":" $bootstrap }}
9+
{{- $bootstrapArgsLen := len $bootstrapArgs }}
10+
{{- if eq $bootstrapArgsLen 3 }}
11+
{{- $bootstrapNamespace = $bootstrapArgs._0 }}
12+
{{- $bootstrapName = $bootstrapArgs._1 }}
13+
{{- $bootstrapVersion = $bootstrapArgs._2 }}
14+
{{- else if eq $bootstrapArgsLen 2 }}
15+
{{- $bootstrapNamespace = print $bootstrapArgs._0 "-bootstrap-system" }}
16+
{{- $bootstrapName = $bootstrapArgs._0 }}
17+
{{- $bootstrapVersion = $bootstrapArgs._1 }}
18+
{{- else if eq $bootstrapArgsLen 1 }}
19+
{{- $bootstrapNamespace = print $bootstrapArgs._0 "-bootstrap-system" }}
20+
{{- $bootstrapName = $bootstrapArgs._0 }}
21+
{{- else }}
22+
{{- fail "bootstrap provider argument should have the following format kubeadm:v1.0.0 or mynamespace:kubeadm:v1.0.0" }}
23+
{{- end }}
624
---
725
apiVersion: v1
826
kind: Namespace
@@ -39,24 +57,5 @@ spec:
3957
namespace: {{ $.Values.configSecret.namespace }}
4058
{{- end }}
4159
{{- end }}
42-
{{- if $bootstrap.manifestPatches }}
43-
manifestPatches: {{ toYaml $bootstrap.manifestPatches | nindent 4 }}
44-
{{- end }}
45-
{{- if $bootstrap.additionalManifests }}
46-
additionalManifests:
47-
name: {{ $bootstrap.additionalManifests.name }}
48-
{{- if $bootstrap.additionalManifests.namespace }}
49-
namespace: {{ $bootstrap.additionalManifests.namespace }}
50-
{{- end }} {{/* if $bootstrap.additionalManifests.namespace */}}
5160
{{- end }}
52-
{{- if $bootstrap.additionalManifests }}
53-
---
54-
apiVersion: v1
55-
kind: ConfigMap
56-
metadata:
57-
name: {{ $bootstrap.additionalManifests.name }}
58-
namespace: {{ default $bootstrapNamespace $bootstrap.additionalManifests.namespace }}
59-
data:
60-
manifests: {{- toYaml $bootstrap.additionalManifests.manifests | nindent 4 }}
6161
{{- end }}
62-
{{- end }} {{/* range $name, $bootstrap := .Values.bootstrap */}}

‎packages/system/capi-operator/charts/cluster-api-operator/templates/control-plane.yaml‎

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,26 @@
11
# Control plane provider
2-
{{- range $name, $controlPlane := $.Values.controlPlane }}
3-
{{- $controlPlaneNamespace := default ( printf "%s-%s" $name "control-plane-system" ) (get $controlPlane "namespace") }}
4-
{{- $controlPlaneName := $name }}
5-
{{- $controlPlaneVersion := get $controlPlane "version" }}
2+
{{- if .Values.controlPlane }}
3+
{{- $controlPlanes := split ";" .Values.controlPlane }}
4+
{{- $controlPlaneNamespace := "" }}
5+
{{- $controlPlaneName := "" }}
6+
{{- $controlPlaneVersion := "" }}
7+
{{- range $controlPlane := $controlPlanes }}
8+
{{- $controlPlaneArgs := split ":" $controlPlane }}
9+
{{- $controlPlaneArgsLen := len $controlPlaneArgs }}
10+
{{- if eq $controlPlaneArgsLen 3 }}
11+
{{- $controlPlaneNamespace = $controlPlaneArgs._0 }}
12+
{{- $controlPlaneName = $controlPlaneArgs._1 }}
13+
{{- $controlPlaneVersion = $controlPlaneArgs._2 }}
14+
{{- else if eq $controlPlaneArgsLen 2 }}
15+
{{- $controlPlaneNamespace = print $controlPlaneArgs._0 "-control-plane-system" }}
16+
{{- $controlPlaneName = $controlPlaneArgs._0 }}
17+
{{- $controlPlaneVersion = $controlPlaneArgs._1 }}
18+
{{- else if eq $controlPlaneArgsLen 1 }}
19+
{{- $controlPlaneNamespace = print $controlPlaneArgs._0 "-control-plane-system" }}
20+
{{- $controlPlaneName = $controlPlaneArgs._0 }}
21+
{{- else }}
22+
{{- fail "controlplane provider argument should have the following format kubeadm:v1.0.0 or mynamespace:kubeadm:v1.0.0" }}
23+
{{- end }}
624
---
725
apiVersion: v1
826
kind: Namespace
@@ -52,24 +70,5 @@ spec:
5270
namespace: {{ $.Values.configSecret.namespace }}
5371
{{- end }}
5472
{{- end }}
55-
{{- if $controlPlane.manifestPatches }}
56-
manifestPatches: {{ toYaml $controlPlane.manifestPatches | nindent 4 }}
5773
{{- end }}
58-
{{- if $controlPlane.additionalManifests }}
59-
additionalManifests:
60-
name: {{ $controlPlane.additionalManifests.name }}
61-
{{- if $controlPlane.additionalManifests.namespace }}
62-
namespace: {{ $controlPlane.additionalManifests.namespace }}
63-
{{- end }} {{/* if $controlPlane.additionalManifests.namespace */}}
6474
{{- end }}
65-
{{- if $controlPlane.additionalManifests }}
66-
---
67-
apiVersion: v1
68-
kind: ConfigMap
69-
metadata:
70-
name: {{ $controlPlane.additionalManifests.name }}
71-
namespace: {{ default $controlPlaneNamespace $controlPlane.additionalManifests.namespace }}
72-
data:
73-
manifests: {{- toYaml $controlPlane.additionalManifests.manifests | nindent 4 }}
74-
{{- end }}
75-
{{- end }} {{/* range $name, $controlPlane := .Values.controlPlane */}}

‎packages/system/capi-operator/charts/cluster-api-operator/templates/core.yaml‎

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
11
# Core provider
2-
{{- range $name, $core := $.Values.core }}
3-
{{- $coreNamespace := default "capi-system" (get $core "namespace") }}
4-
{{- $coreName := $name }}
5-
{{- $coreVersion := get $core "version" }}
2+
{{- if .Values.core }}
3+
{{- $coreArgs := split ":" .Values.core }}
4+
{{- $coreArgsLen := len $coreArgs }}
5+
{{- $coreVersion := "" }}
6+
{{- $coreNamespace := "" }}
7+
{{- $coreName := "" }}
8+
{{- $coreVersion := "" }}
9+
{{- if eq $coreArgsLen 3 }}
10+
{{- $coreNamespace = $coreArgs._0 }}
11+
{{- $coreName = $coreArgs._1 }}
12+
{{- $coreVersion = $coreArgs._2 }}
13+
{{- else if eq $coreArgsLen 2 }}
14+
{{- $coreNamespace = "capi-system" }}
15+
{{- $coreName = $coreArgs._0 }}
16+
{{- $coreVersion = $coreArgs._1 }}
17+
{{- else if eq $coreArgsLen 1 }}
18+
{{- $coreNamespace = "capi-system" }}
19+
{{- $coreName = $coreArgs._0 }}
20+
{{- else }}
21+
{{- fail "core provider argument should have the following format cluster-api:v1.0.0 or mynamespace:cluster-api:v1.0.0" }}
22+
{{- end }}
623
---
724
apiVersion: v1
825
kind: Namespace
@@ -48,24 +65,4 @@ spec:
4865
namespace: {{ $.Values.configSecret.namespace }}
4966
{{- end }}
5067
{{- end }}
51-
{{- if $core.manifestPatches }}
52-
manifestPatches: {{ toYaml $core.manifestPatches | nindent 4 }}
5368
{{- end }}
54-
{{- if $core.additionalManifests }}
55-
additionalManifests:
56-
name: {{ $core.additionalManifests.name }}
57-
{{- if $core.additionalManifests.namespace }}
58-
namespace: {{ $core.additionalManifests.namespace }}
59-
{{- end }}
60-
{{- end }}
61-
{{- if $core.additionalManifests }}
62-
---
63-
apiVersion: v1
64-
kind: ConfigMap
65-
metadata:
66-
name: {{ $core.additionalManifests.name }}
67-
namespace: {{ default $coreNamespace $core.additionalManifests.namespace }}
68-
data:
69-
manifests: {{- toYaml $core.additionalManifests.manifests | nindent 4 }}
70-
{{- end }}
71-
{{- end }} {{/* range $name, $core := .Values.core */}}

‎packages/system/capi-operator/charts/cluster-api-operator/templates/infra.yaml‎

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,26 @@
11
# Infrastructure providers
2-
{{- range $name, $infra := $.Values.infrastructure }}
3-
{{- $infrastructureNamespace := default ( printf "%s-%s" $name "infrastructure-system" ) (get $infra "namespace") }}
4-
{{- $infrastructureName := $name }}
5-
{{- $infrastructureVersion := get $infra "version" }}
2+
{{- if .Values.infrastructure }}
3+
{{- $infrastructures := split ";" .Values.infrastructure }}
4+
{{- $infrastructureNamespace := "" }}
5+
{{- $infrastructureName := "" }}
6+
{{- $infrastructureVersion := "" }}
7+
{{- range $infrastructure := $infrastructures }}
8+
{{- $infrastructureArgs := split ":" $infrastructure }}
9+
{{- $infrastructureArgsLen := len $infrastructureArgs }}
10+
{{- if eq $infrastructureArgsLen 3 }}
11+
{{- $infrastructureNamespace = $infrastructureArgs._0 }}
12+
{{- $infrastructureName = $infrastructureArgs._1 }}
13+
{{- $infrastructureVersion = $infrastructureArgs._2 }}
14+
{{- else if eq $infrastructureArgsLen 2 }}
15+
{{- $infrastructureNamespace = print $infrastructureArgs._0 "-infrastructure-system" }}
16+
{{- $infrastructureName = $infrastructureArgs._0 }}
17+
{{- $infrastructureVersion = $infrastructureArgs._1 }}
18+
{{- else if eq $infrastructureArgsLen 1 }}
19+
{{- $infrastructureNamespace = print $infrastructureArgs._0 "-infrastructure-system" }}
20+
{{- $infrastructureName = $infrastructureArgs._0 }}
21+
{{- else }}
22+
{{- fail "infrastructure provider argument should have the following format aws:v1.0.0 or mynamespace:aws:v1.0.0" }}
23+
{{- end }}
624
---
725
apiVersion: v1
826
kind: Namespace
@@ -65,24 +83,5 @@ spec:
6583
{{- if $.Values.additionalDeployments }}
6684
additionalDeployments: {{ toYaml $.Values.additionalDeployments | nindent 4 }}
6785
{{- end }}
68-
{{- if $infra.manifestPatches }}
69-
manifestPatches: {{- toYaml $infra.manifestPatches | nindent 4 }}
70-
{{- end }} {{/* if $infra.manifestPatches */}}
71-
{{- if $infra.additionalManifests }}
72-
additionalManifests:
73-
name: {{ $infra.additionalManifests.name }}
74-
{{- if $infra.additionalManifests.namespace }}
75-
namespace: {{ $infra.additionalManifests.namespace }}
76-
{{- end }} {{/* if $infra.additionalManifests.namespace */}}
77-
{{- end }} {{/* if $infra.additionalManifests */}}
78-
{{- if $infra.additionalManifests }}
79-
---
80-
apiVersion: v1
81-
kind: ConfigMap
82-
metadata:
83-
name: {{ $infra.additionalManifests.name }}
84-
namespace: {{ default $infrastructureNamespace $infra.additionalManifests.namespace }}
85-
data:
86-
manifests: {{- toYaml $infra.additionalManifests.manifests | nindent 4 }}
8786
{{- end }}
88-
{{- end }} {{/* range $name, $infra := .Values.infrastructure */}}
87+
{{- end }}

‎packages/system/capi-operator/charts/cluster-api-operator/templates/ipam.yaml‎

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,26 @@
11
# IPAM providers
2-
{{- range $name, $ipam := $.Values.ipam }}
3-
{{- $ipamNamespace := default ( printf "%s-%s" $name "ipam-system" ) (get $ipam "namespace") }}
4-
{{- $ipamName := $name }}
5-
{{- $ipamVersion := get $ipam "version" }}
2+
{{- if .Values.ipam }}
3+
{{- $ipams := split ";" .Values.ipam }}
4+
{{- $ipamNamespace := "" }}
5+
{{- $ipamName := "" }}
6+
{{- $ipamVersion := "" }}
7+
{{- range $ipam := $ipams }}
8+
{{- $ipamArgs := split ":" $ipam }}
9+
{{- $ipamArgsLen := len $ipamArgs }}
10+
{{- if eq $ipamArgsLen 3 }}
11+
{{- $ipamNamespace = $ipamArgs._0 }}
12+
{{- $ipamName = $ipamArgs._1 }}
13+
{{- $ipamVersion = $ipamArgs._2 }}
14+
{{- else if eq $ipamArgsLen 2 }}
15+
{{- $ipamNamespace = print $ipamArgs._0 "-ipam-system" }}
16+
{{- $ipamName = $ipamArgs._0 }}
17+
{{- $ipamVersion = $ipamArgs._1 }}
18+
{{- else if eq $ipamArgsLen 1 }}
19+
{{- $ipamNamespace = print $ipamArgs._0 "-ipam-system" }}
20+
{{- $ipamName = $ipamArgs._0 }}
21+
{{- else }}
22+
{{- fail "ipam provider argument should have the following format in-cluster:v1.0.0 or mynamespace:in-cluster:v1.0.0" }}
23+
{{- end }}
624
---
725
apiVersion: v1
826
kind: Namespace
@@ -52,27 +70,8 @@ spec:
5270
namespace: {{ $.Values.configSecret.namespace }}
5371
{{- end }}
5472
{{- end }}
55-
{{- if $ipam.manifestPatches }}
56-
manifestPatches: {{ toYaml $ipam.manifestPatches | nindent 4 }}
57-
{{- end }}
5873
{{- if $.Values.additionalDeployments }}
5974
additionalDeployments: {{ toYaml $.Values.additionalDeployments | nindent 4 }}
6075
{{- end }}
61-
{{- if $ipam.additionalManifests }}
62-
additionalManifests:
63-
name: {{ $ipam.additionalManifests.name }}
64-
{{- if $ipam.additionalManifests.namespace }}
65-
namespace: {{ $ipam.additionalManifests.namespace }}
66-
{{- end }} {{/* if $ipam.additionalManifests.namespace */}}
6776
{{- end }}
68-
{{- if $ipam.additionalManifests }}
69-
---
70-
apiVersion: v1
71-
kind: ConfigMap
72-
metadata:
73-
name: {{ $ipam.additionalManifests.name }}
74-
namespace: {{ default $ipamNamespace $ipam.additionalManifests.namespace }}
75-
data:
76-
manifests: {{- toYaml $ipam.additionalManifests.manifests | nindent 4 }}
7777
{{- end }}
78-
{{- end }} {{/* range $name, $ipam := .Values.ipam */}}

0 commit comments

Comments
 (0)