Skip to content

Commit 9148bc8

Browse files
authored
Merge pull request noobaa#1849 from shirady/list-obc-show-remote-by-default
OBC on Hosted Cluster | OBC list by default would include remobe obc
2 parents b18f363 + d0a40e2 commit 9148bc8

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

pkg/obc/obc.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ func CmdList() *cobra.Command {
117117
Run: RunList,
118118
Args: cobra.NoArgs,
119119
}
120+
cmd.Flags().Bool("local-obc-only", false,
121+
"List only local OBCs (exclude remote OBCs created for client clusters)")
120122
return cmd
121123
}
122124

@@ -497,6 +499,7 @@ func RunStatus(cmd *cobra.Command, args []string) {
497499

498500
// RunList runs a CLI command
499501
func RunList(cmd *cobra.Command, args []string) {
502+
localObcOnly, _ := cmd.Flags().GetBool("local-obc-only")
500503
list := &nbv1.ObjectBucketClaimList{
501504
TypeMeta: metav1.TypeMeta{Kind: "ObjectBucketClaim"},
502505
}
@@ -521,7 +524,7 @@ func RunList(cmd *cobra.Command, args []string) {
521524
obc := &list.Items[i]
522525

523526
// Do not show remote OBCs in the list (OBCs that were created for client clusters)
524-
if util.IsRemoteObcAnnotation(obc.Annotations) {
527+
if localObcOnly && util.IsRemoteObcAnnotation(obc.Annotations) {
525528
countRemoteOBCs++
526529
continue
527530
}

0 commit comments

Comments
 (0)