File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -36,12 +36,16 @@ func showCluster(args []string) {
3636 myselector := labels .Everything ()
3737 log .Debug ("selector is " + Labelselector )
3838 if Labelselector != "" {
39+ args = make ([]string , 1 )
40+ args [0 ] = "all"
3941 myselector , err = labels .Parse (Labelselector )
4042 if err != nil {
4143 log .Error ("could not parse --selector value " + err .Error ())
4244 return
4345 }
4446 }
47+
48+ log .Debugf ("label selector is [%v]\n " , myselector )
4549 err = Tprclient .Get ().
4650 Resource (tpr .CLUSTER_RESOURCE ).
4751 Namespace (Namespace ).
@@ -69,7 +73,7 @@ func showCluster(args []string) {
6973 if PostgresVersion == "" || (PostgresVersion != "" && cluster .Spec .POSTGRES_FULL_VERSION == PostgresVersion ) {
7074 fmt .Println ("cluster : " + cluster .Spec .Name + " (" + cluster .Spec .POSTGRES_FULL_VERSION + ")" )
7175 log .Debug ("listing cluster " + arg )
72- fmt . Printf ("last password update %v\n " , cluster .Spec .PSW_LAST_UPDATE )
76+ log . Debugf ("last password update %v\n " , cluster .Spec .PSW_LAST_UPDATE )
7377 //list the deployments
7478 listDeployments (cluster .Spec .Name )
7579 //list the replicasets
@@ -310,9 +314,13 @@ func getClusterParams(name string) *tpr.PgCluster {
310314 spec .BACKUP_PVC_NAME = BackupPVC
311315 }
312316
317+ labels := make (map [string ]string )
318+ labels ["name" ] = name
319+
313320 newInstance := & tpr.PgCluster {
314321 Metadata : meta_v1.ObjectMeta {
315- Name : name ,
322+ Name : name ,
323+ Labels : labels ,
316324 },
317325 Spec : spec ,
318326 }
Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ var ShowClusterCmd = &cobra.Command{
164164
165165 pgo show cluster mycluster` ,
166166 Run : func (cmd * cobra.Command , args []string ) {
167- if len (args ) == 0 {
167+ if Labelselector == "" && len (args ) == 0 {
168168 log .Error ("cluster name(s) required for this command" )
169169 } else {
170170 showCluster (args )
You can’t perform that action at this time.
0 commit comments