Skip to content

Commit 9aa303d

Browse files
committed
ci: adds n-2 flag
1 parent bd77d06 commit 9aa303d

File tree

4 files changed

+24
-3
lines changed

4 files changed

+24
-3
lines changed

hack/addons/generate-mindthegap-repofile.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,20 @@ ASSETS_DIR="$(mktemp -d -p "${TMPDIR:-/tmp}")"
1313
cp "${GIT_REPO_ROOT}/charts/cluster-api-runtime-extensions-nutanix/templates/helm-config.yaml" "${ASSETS_DIR}"
1414

1515
gh release download "${PREVIOUS_CAREN_CHARTS_VERSION}" \
16-
-p "runtime-extension-components.yaml" -D "${ASSETS_DIR}/" --clobber
16+
-p "runtime-extension-components.yaml" -O "${ASSETS_DIR}/runtime-extension-components-n-1.yaml"
1717

18-
yq e '. | select(.metadata.name == "default-helm-addons-config")' >>"${ASSETS_DIR}/previous-charts.yaml" <"${ASSETS_DIR}/runtime-extension-components.yaml"
18+
gh release download "${CAREN_CHARTS_VERSION_N_MINUS_2}" \
19+
-p "runtime-extension-components.yaml" -O "${ASSETS_DIR}/runtime-extension-components-n-2.yaml"
20+
21+
yq e '. | select(.metadata.name == "default-helm-addons-config")' >>"${ASSETS_DIR}/previous-charts.yaml" <"${ASSETS_DIR}/runtime-extension-components-n-1.yaml"
22+
23+
yq e '. | select(.metadata.name == "default-helm-addons-config")' >>"${ASSETS_DIR}/n-2-charts.yaml" <"${ASSETS_DIR}/runtime-extension-components-n-2.yaml"
1924

2025
# this sed line is needed because the go library is unable to parse yaml with a template string.
2126
sed -i s/"{{ .Values.helmAddonsConfigMap }}"/placeholder/g "${ASSETS_DIR}/helm-config.yaml"
2227
go run "${GIT_REPO_ROOT}/hack/tools/mindthegap-helm-reg/main.go" --input-configmap-file="${ASSETS_DIR}/helm-config.yaml" --output-file="${ASSETS_DIR}/repos.yaml" \
23-
--previous-configmap-file="${ASSETS_DIR}/previous-charts.yaml"
28+
--previous-configmap-file="${ASSETS_DIR}/previous-charts.yaml" \
29+
--n-minus-2-configmap-file="${ASSETS_DIR}/n-2-charts.yaml" \
2430

2531
# add warning not to edit file directly
2632
cat <<EOF >"${GIT_REPO_ROOT}/hack/addons/mindthegap-helm-registry/repos.yaml"

hack/addons/mindthegap-helm-registry/repos.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ repositories:
5151
charts:
5252
nutanix-cloud-provider:
5353
- 0.4.1
54+
- 0.4.0
5455
nutanix-csi-storage:
5556
repoURL: https://nutanix.github.io/helm-releases/
5657
charts:

hack/tools/mindthegap-helm-reg/main.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ func main() {
4141
outputFile string
4242
inputConfigMapFile string
4343
previousConfigMapFile string
44+
nminus2ConfigMapFile string
4445
)
4546
flagSet := flag.NewFlagSet("mindthegap-helm-registry", flag.ExitOnError)
4647
flagSet.StringVar(
@@ -61,6 +62,12 @@ func main() {
6162
"",
6263
"input configmap file to create the mindthegap repo file from",
6364
)
65+
flagSet.StringVar(
66+
&nminus2ConfigMapFile,
67+
"n-minus-2-configmap-file",
68+
"",
69+
"input configmap file to create the mindthegap repo file from",
70+
)
6471
err := flagSet.Parse(args[1:])
6572
if err != nil {
6673
log.Error(err, "failed to parse args")
@@ -78,6 +85,11 @@ func main() {
7885
log.Error(err, fmt.Sprintf("failed to get configmap from file %s %w", inputConfigMapFile, err))
7986
}
8087
ConfigMapToHelmChartConfig(&out, previousCm)
88+
nMinus2Cm, err := getConfigMapFromFile(nminus2ConfigMapFile)
89+
if err != nil {
90+
log.Error(err, fmt.Sprintf("failed to get configmap from file %s %w", inputConfigMapFile, err))
91+
}
92+
ConfigMapToHelmChartConfig(&out, nMinus2Cm)
8193
b, err := yaml.Marshal(out)
8294
if err != nil {
8395
log.Error(err, fmt.Sprintf("failed to marshal obj %v", out))

make/addons.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ export KUBE_VIP_VERSION := v0.8.3
2525

2626
export METALLB_CHART_VERSION := 0.14.8
2727

28+
# these versions correspond to n-1 and n-2 shipped releases.
2829
export PREVIOUS_CAREN_CHARTS_VERSION := v0.14.6
30+
export CAREN_CHARTS_VERSION_N_MINUS_2 := v0.13.7
2931

3032
.PHONY: addons.sync
3133
addons.sync: $(addprefix update-addon.,calico cilium nfd cluster-autoscaler snapshot-controller local-path-provisioner-csi aws-ebs-csi kube-vip)

0 commit comments

Comments
 (0)