diff --git a/packaging/flavorgen/cmd/root.go b/packaging/flavorgen/cmd/root.go index 0151e909cb..01f9c8b849 100644 --- a/packaging/flavorgen/cmd/root.go +++ b/packaging/flavorgen/cmd/root.go @@ -132,7 +132,11 @@ func generateSingle(flavor string) (string, error) { case flavors.ClusterClass: objs = flavors.ClusterClassTemplateWithKubeVIP() case flavors.ClusterTopology: - objs = flavors.ClusterTopologyTemplateKubeVIP() + var err error + objs, err = flavors.ClusterTopologyTemplateKubeVIP() + if err != nil { + return "", err + } replacements = append(replacements, util.Replacement{ Kind: "Cluster", Name: "${CLUSTER_NAME}", diff --git a/packaging/flavorgen/flavors/flavors.go b/packaging/flavorgen/flavors/flavors.go index 82eb8a64b3..dbed2c2777 100644 --- a/packaging/flavorgen/flavors/flavors.go +++ b/packaging/flavorgen/flavors/flavors.go @@ -54,10 +54,10 @@ func ClusterClassTemplateWithKubeVIP() []runtime.Object { return ClusterClassTemplate } -func ClusterTopologyTemplateKubeVIP() []runtime.Object { +func ClusterTopologyTemplateKubeVIP() ([]runtime.Object, error) { cluster, err := newClusterTopologyCluster() if err != nil { - return nil + return nil, err } identitySecret := newIdentitySecret() clusterResourceSet := newClusterResourceSet(cluster) @@ -70,7 +70,7 @@ func ClusterTopologyTemplateKubeVIP() []runtime.Object { } MultiNodeTemplate = append(MultiNodeTemplate, crsResourcesCSI...) MultiNodeTemplate = append(MultiNodeTemplate, crsResourcesCPI...) - return MultiNodeTemplate + return MultiNodeTemplate, nil } func MultiNodeTemplateWithKubeVIP() []runtime.Object {