Skip to content

Commit

Permalink
Merge pull request #2274 from chrischdi/pr-fix-error-handling-Cluster…
Browse files Browse the repository at this point in the history
…TopologyTemplateKubeVIP

🌱 flavor-gen: fix error handling in ClusterTopologyTemplateKubeVIP
  • Loading branch information
k8s-ci-robot authored Aug 24, 2023
2 parents 2ddce8c + 4921aed commit de5ee99
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion packaging/flavorgen/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}",
Expand Down
6 changes: 3 additions & 3 deletions packaging/flavorgen/flavors/flavors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 {
Expand Down

0 comments on commit de5ee99

Please sign in to comment.