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 @@ -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 )
You can’t perform that action at this time.
0 commit comments