Skip to content

Commit a156858

Browse files
committed
fix: cilium templating for list-images
1 parent fb91dbb commit a156858

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

charts/cluster-api-runtime-extensions-nutanix/addons/cni/cilium/values-template.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ socketLB:
3838
envoy:
3939
image:
4040
useDigest: false
41+
k8sServiceHost: "{{ trimPrefix .ControlPlaneEndpoint.Host "https://" }}"
42+
k8sServicePort: "{{ .ControlPlaneEndpoint.Port }}"
4143
{{- if .EnableKubeProxyReplacement }}
4244
kubeProxyReplacement: true
4345
{{- end }}
44-
k8sServiceHost: "{{ trimPrefix .ControlPlaneEndpoint.Host "https://" }}"
45-
k8sServicePort: "{{ .ControlPlaneEndpoint.Port }}"
4646
{{- if eq .Provider "eks" }}
4747
enableIPv4Masquerade: false
4848
eni:

hack/tools/fetch-images/main.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,13 +266,24 @@ func getValuesFileForChartIfNeeded(chartName, carenChartDirectory string) (strin
266266
}
267267

268268
type input struct {
269+
Provider string
270+
ControlPlaneEndpoint clusterv1.APIEndpoint
269271
EnableKubeProxyReplacement bool
270272
}
271273
templateInput := input{
274+
Provider: "test",
275+
ControlPlaneEndpoint: clusterv1.APIEndpoint{
276+
Host: "https://test.dummy.com",
277+
Port: 443,
278+
},
272279
EnableKubeProxyReplacement: true,
273280
}
274281

275-
err = template.Must(template.New(defaultHelmAddonFilename).ParseFiles(f)).Execute(tempFile, &templateInput)
282+
funcMap := template.FuncMap{
283+
"trimPrefix": strings.TrimPrefix,
284+
}
285+
err = template.Must(
286+
template.New(defaultHelmAddonFilename).Funcs(funcMap).ParseFiles(f)).Execute(tempFile, &templateInput)
276287
if err != nil {
277288
return "", fmt.Errorf("failed to execute helm values template %w", err)
278289
}

0 commit comments

Comments
 (0)