MCPcopy
hub / github.com/kubevela/kubevela / GetCluster

Function GetCluster

pkg/cmd/utils.go:85–92  ·  view source on GitHub ↗

GetCluster get cluster from command flags

(cmd *cobra.Command)

Source from the content-addressed store, hash-verified

83
84// GetCluster get cluster from command flags
85func GetCluster(cmd *cobra.Command) string {
86 cluster, err := cmd.Flags().GetString(flagCluster)
87 cmdutil.CheckErr(err)
88 if cluster == "" {
89 return types.ClusterLocalName
90 }
91 return cluster
92}
93
94// GetClusters get cluster from command flags
95func GetClusters(cmd *cobra.Command) []string {

Callers

nothing calls this directly

Calls 1

FlagsMethod · 0.80

Tested by

no test coverage detected