Skip to content

Commit ab9e9ab

Browse files
committed
fix: hack for parsing template using gomplate
1 parent 69cc4c6 commit ab9e9ab

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

hack/addons/update-cilium-manifests.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,15 @@ envsubst -no-unset <"${KUSTOMIZE_BASE_DIR}/kustomization.yaml.tmpl" >"${ASSETS_D
2525

2626
cat <<EOF >"${ASSETS_DIR}/gomplate-context.yaml"
2727
EnableKubeProxyReplacement: false
28+
Cluster:
29+
Labels:
30+
cluster.x-k8s.io/provider: tmpl-capiprovider-tmpl
2831
EOF
29-
gomplate -f "${GIT_REPO_ROOT}/charts/cluster-api-runtime-extensions-nutanix/addons/cni/cilium/values-template.yaml" \
30-
--context .="${ASSETS_DIR}/gomplate-context.yaml" \
31-
>"${ASSETS_DIR}/helm-values.yaml"
32+
# Replace trimPrefix with strings.TrimPrefix to use the in built go function in gomplate.
33+
sed 's/trimPrefix/strings.TrimPrefix/g' \
34+
"${GIT_REPO_ROOT}/charts/cluster-api-runtime-extensions-nutanix/addons/cni/cilium/values-template.yaml" |
35+
gomplate --context .="${ASSETS_DIR}/gomplate-context.yaml" \
36+
>"${ASSETS_DIR}/helm-values.yaml"
3237

3338
kustomize build \
3439
--load-restrictor LoadRestrictionsNone \

0 commit comments

Comments
 (0)