Skip to content

Commit cb9b3c2

Browse files
committed
build: fix list-images for AWS LB controller
1 parent 58197d6 commit cb9b3c2

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
@@ -407,12 +407,24 @@ prismEndPoint: endpoint
407407
return "", fmt.Errorf("failed to create temp file: %w", err)
408408
}
409409

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

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

0 commit comments

Comments
 (0)