Skip to content

Commit 808932b

Browse files
authored
build: fix list-images for AWS LB controller (#1364)
**What problem does this PR solve?**: Follow up to #1341, I forgot to update this automation after changing the template. That PR broke list-images, but now with #1359 there's a preflight that catches these types of errors. **Which issue(s) this PR fixes**: Fixes # **How Has This Been Tested?**: <!-- Please describe the tests that you ran to verify your changes. Provide output from the tests and any manual steps needed to replicate the tests. --> **Special notes for your reviewer**: <!-- Use this to provide any additional information to the reviewers. This may include: - Best way to review the PR. - Where the author wants the most review attention on. - etc. -->
1 parent 58197d6 commit 808932b

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)