apecloud / kubeblocks

KubeBlocks is an open-source control plane software that runs and manages databases, message queues and other stateful applications on K8s.
https://kubeblocks.io
GNU Affero General Public License v3.0
2.18k stars 181 forks source link

[BUG]1.0 kbcli cluster list-instances failed If the cluster is set to a non-default namespace #8448

Closed tianyue86 closed 4 days ago

tianyue86 commented 1 week ago

Describe the env

tianyue@apeclouds-MacBook-Pro kbcli % kbcli version
Kubernetes: v1.30.4-eks-a737599
KubeBlocks: 1.0.0-beta.1
kbcli: 1.0.0-alpha.1

To Reproduce Steps to reproduce the behavior:

  1. Create two minio clusters under two different namespaces: default and ns-fdmmygzgoq
    tianyue@apeclouds-MacBook-Pro kbcli % k get cluster -A
    NAMESPACE       NAME           CLUSTER-DEFINITION   TERMINATION-POLICY   STATUS    AGE
    default         minio-ctvaye                        WipeOut              Running   19h
    ns-fdmmygzgoq   minio-mirror                        WipeOut              Running   60s
  2. list-instances failed If the cluster is set to a non-default namespace
    tianyue@apeclouds-MacBook-Pro kbcli % kbcli cluster list-instances minio-mirror --namespace ns-fdmmygzgoq
    Error from server (NotFound): clusters.apps.kubeblocks.io "minio-mirror" not found
  3. list-instances success If the cluster is set to default namespace
tianyue@apeclouds-MacBook-Pro kbcli % kbcli cluster list-instances minio-ctvaye --namespace default
NAME                   NAMESPACE   CLUSTER        COMPONENT   STATUS    ROLE     ACCESSMODE   AZ                CPU(REQUEST/LIMIT)   MEMORY(REQUEST/LIMIT)   STORAGE    NODE                                                         CREATED-TIME                 
minio-ctvaye-minio-0   default     minio-ctvaye   minio       Running   <none>   <none>       ap-northeast-1c   100m / 100m          512Mi / 512Mi           data:4Gi   ip-172-31-7-55.ap-northeast-1.compute.internal/172.31.7.55   Nov 13,2024 17:16 UTC+0800   
minio-ctvaye-minio-1   default     minio-ctvaye   minio       Running   <none>   <none>       ap-northeast-1c   100m / 100m          512Mi / 512Mi           data:4Gi   ip-172-31-8-24.ap-northeast-1.compute.internal/172.31.8.24   Nov 13,2024 17:16 UTC+0800  

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.