diff --git a/cmd/cluster.go b/cmd/cluster.go index 8839f3c4..ceeacc1a 100644 --- a/cmd/cluster.go +++ b/cmd/cluster.go @@ -259,6 +259,8 @@ func init() { }) // Cluster list -------------------------------------------------------------------- + clusterListCmd.Flags().String("id", "", "show clusters of given id") + clusterListCmd.Flags().String("name", "", "show clusters of given name") clusterListCmd.Flags().String("project", "", "show clusters of given project") clusterListCmd.Flags().String("partition", "", "show clusters in partition") clusterListCmd.Flags().String("tenant", "", "show clusters of given tenant") @@ -477,12 +479,21 @@ func clusterCreate() error { } func clusterList() error { + id := viper.GetString("id") + name := viper.GetString("name") tenant := viper.GetString("tenant") partition := viper.GetString("partition") project := viper.GetString("project") var cfr *models.V1ClusterFindRequest - if tenant != "" || partition != "" || project != "" { + if id != "" || name != "" || tenant != "" || partition != "" || project != "" { cfr = &models.V1ClusterFindRequest{} + + if id != "" { + cfr.ID = &id + } + if name != "" { + cfr.Name = &name + } if tenant != "" { cfr.Tenant = &tenant } diff --git a/go.mod b/go.mod index 367577a4..9ee060c9 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.15 require ( github.com/Masterminds/semver v1.5.0 github.com/fatih/color v1.9.0 - github.com/fi-ts/cloud-go v0.8.1 + github.com/fi-ts/cloud-go v0.8.2 github.com/gardener/gardener v1.8.2 github.com/go-openapi/runtime v0.19.21 github.com/go-openapi/strfmt v0.19.5 diff --git a/go.sum b/go.sum index 135a9ad3..4604a76a 100644 --- a/go.sum +++ b/go.sum @@ -193,8 +193,8 @@ github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLi github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= -github.com/fi-ts/cloud-go v0.8.1 h1:IUcZA7gDIoc2ULLMhyfbnfqH2tdI/juZimjkeFfWwK4= -github.com/fi-ts/cloud-go v0.8.1/go.mod h1:10CDK7f0l/7v0UyvjjQSFpWGZYVo6IUsKOTezGpSyYM= +github.com/fi-ts/cloud-go v0.8.2 h1:fmOrAz531Y1Bt+GyCibNu1+NRphSsrYcq2iO9QDUtMs= +github.com/fi-ts/cloud-go v0.8.2/go.mod h1:10CDK7f0l/7v0UyvjjQSFpWGZYVo6IUsKOTezGpSyYM= github.com/frankban/quicktest v1.5.0/go.mod h1:jaStnuzAqU1AJdCO0l53JDCJrVDKcS03DbaAcR7Ks/o= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=