zowe / zowe-cli-secrets-for-kubernetes

Eclipse Public License 2.0
0 stars 0 forks source link

Default namespace not supported #9

Closed zFernand0 closed 1 year ago

zFernand0 commented 1 year ago

It is possible for a cluster configuration to not have a namespace defined in its context. For example:

{
  "cluster": "gke_demos_us_zowe-explorer",
  "name": "gke_demos_us_zowe-explorer",
  "user": "gke_demos_us_zowe-explorer"
}

In setupKubeConfig: https://github.com/zowe/zowe-cli-secrets-for-kubernetes/blob/d494ce07a83af70363e04c4960cbc6936b23df3f/packages/cli/src/credentials/K8sCredentialManager.ts#L198

Maybe we can curious if we should fallback to default instead of the same name?

const k8sNamespace = currentContext.namespace ?? "default";