Skip to content

Commit 2f52899

Browse files
Simon Emmsroboquat
Simon Emms
authored andcommitted
[installer]: allow for minified config YAML
The regex for the `apiVersion` errored if the YAML was minified, which is what we're using in KOTS installation job.
1 parent 9480809 commit 2f52899

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

install/installer/pkg/config/loader.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ func Load(overrideConfig string) (cfg interface{}, version string, err error) {
105105

106106
// `apiVersion: vx` line is removed from config since the version dependant
107107
// Config structure doesn't have that field
108-
apiVersionRegexp := regexp.MustCompile(`apiVersion: .+\n`)
108+
// The line-ending is either comma (minified YAML) or newline (unminified)
109+
apiVersionRegexp := regexp.MustCompile(`apiVersion: ` + apiVersion + `(,|\n)`)
109110
overrideConfig = apiVersionRegexp.ReplaceAllString(overrideConfig, "")
110111

111112
// Override passed configuration onto the default

install/kots/manifests/gitpod-installer-job.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ spec:
2121
containers:
2222
- name: installer
2323
# This will normally be the release tag - using this tag as need the license evaluator
24-
image: 'eu.gcr.io/gitpod-core-dev/build/installer:sje-kots-helm.7'
24+
image: 'eu.gcr.io/gitpod-core-dev/build/installer:sje-installer-mini-config.0'
2525
volumeMounts:
2626
- mountPath: /config-patch
2727
name: config-patch
@@ -171,6 +171,7 @@ spec:
171171
appVersion: "$(/app/installer version | yq e '.version' -)"
172172
EOF
173173
174+
echo "Gitpod: render Kubernetes manifests"
174175
/app/installer render -c "${CONFIG_FILE}" --namespace {{repl Namespace }} > "${GITPOD_OBJECTS}/templates/gitpod.yaml"
175176
176177
# Workaround for #8532 and #8529

0 commit comments

Comments
 (0)