Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 10: Pick default namespace if no namespace is provided #12

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pratikkumar-mohite
Copy link

The default namespace is getting selected if no namespace is provided.
It was tested with following flows

  1. Without any namespace - if secret present
❯ kubectl secretdata default-ns-secret -o json                                                                                                                       
{
    "default": {
        "default-ns-secret": {
            "password": "testpassword",
            "username": "testuser"
        }
    }
}

❯ kubectl secretdata default-ns-secret                                                                                                                               
default:
  default-ns-secret:
    password: testpassword
    username: testuser
  1. Without any namespace - if secret does not exists
❯ kubectl secretdata default-ns-secret2                                                                                                                               
Error from server (NotFound): secrets "default-ns-secret2" not found
  1. With all namespaces
❯ kubectl secretdata -A                                                                                                                                               
default:
  default-ns-secret:
    password: testpassword
    username: testuser
istio-system:
  istio-ca-secret:
    ca-cert.pem: |
      -----BEGIN CERTIFICATE-----
      .................................................
      -----END CERTIFICATE-----
    ca-key.pem: |
    -----BEGIN RSA PRIVATE KEY-----
    .................................................
    -----END RSA PRIVATE KEY-----
    cert-chain.pem: ""
    key.pem: ""
    root-cert.pem: |
      -----BEGIN CERTIFICATE-----
      .................................................
      -----END CERTIFICATE-----
kube-system:
  bootstrap-token-abc:
    auth-extra-groups: system:bootstrappers:kubeadm:default-node-token
    expiration: "2024-09-21T13:56:03Z"
test:
  test-ns-secret:
    password: testpassword2
    username: testuser2
  1. With Multiple namespaces
❯ kubectl secretdata -m default,test                                                                                                                                             
default:
  default-ns-secret:
    password: testpassword
    username: testuser
test:
  test-ns-secret:
    password: testpassword2
    username: testuser2

Closes #10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use current context namespace as default
1 participant