Skip to content

Commit aad7848

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

File tree

4 files changed

+15
-22
lines changed

4 files changed

+15
-22
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:

common/pkg/capi/utils/annotations.go

Lines changed: 0 additions & 18 deletions
This file was deleted.

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
}

pkg/handlers/generic/lifecycle/cni/cilium/template_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func createTestCluster(t *testing.T, name, namespace, provider, host string, por
117117

118118
cluster := builder.Cluster(namespace, name).
119119
WithLabels(map[string]string{
120-
"cluster.x-k8s.io/provider": provider,
120+
clusterv1.ProviderNameLabel: provider,
121121
}).
122122
WithTopology(topology).
123123
Build()

0 commit comments

Comments
 (0)