File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments