Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions hack/tools/fetch-images/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,12 +407,24 @@ prismEndPoint: endpoint
return "", fmt.Errorf("failed to create temp file: %w", err)
}

templateInput := map[string]interface{}{
"InfraCluster": map[string]interface{}{
"spec": map[string]interface{}{
"eksClusterName": "tmplCluster",
// CAAPH uses unstructured internally, so we need to create an unstructured copy of a cluster
// to pass to the CAAPH values template.
c, err := runtime.DefaultUnstructuredConverter.ToUnstructured(&clusterv1.Cluster{
ObjectMeta: metav1.ObjectMeta{
Name: "tmplCluster",
Labels: map[string]string{
"cluster.x-k8s.io/provider": "aws",
},
},
})
if err != nil {
return "", fmt.Errorf("failed to convert cluster to unstructured %w", err)
}

templateInput := struct {
Cluster map[string]interface{}
}{
Cluster: c,
}

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