Skip to content

Commit a943238

Browse files
Merge remote-tracking branch 'origin/main' into vijayr/109585-k8sagent-addon-2
2 parents fc1e937 + 808932b commit a943238

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

hack/tools/fetch-images/main.go

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -409,12 +409,24 @@ prismEndPoint: endpoint
409409
return "", fmt.Errorf("failed to create temp file: %w", err)
410410
}
411411

412-
templateInput := map[string]interface{}{
413-
"InfraCluster": map[string]interface{}{
414-
"spec": map[string]interface{}{
415-
"eksClusterName": "tmplCluster",
412+
// CAAPH uses unstructured internally, so we need to create an unstructured copy of a cluster
413+
// to pass to the CAAPH values template.
414+
c, err := runtime.DefaultUnstructuredConverter.ToUnstructured(&clusterv1.Cluster{
415+
ObjectMeta: metav1.ObjectMeta{
416+
Name: "tmplCluster",
417+
Labels: map[string]string{
418+
"cluster.x-k8s.io/provider": "aws",
416419
},
417420
},
421+
})
422+
if err != nil {
423+
return "", fmt.Errorf("failed to convert cluster to unstructured %w", err)
424+
}
425+
426+
templateInput := struct {
427+
Cluster map[string]interface{}
428+
}{
429+
Cluster: c,
418430
}
419431

420432
err = template.Must(template.New(defaultHelmAddonFilename).ParseFiles(f)).Execute(tempFile, &templateInput)

0 commit comments

Comments
 (0)