intellij-openshift-connector icon indicating copy to clipboard operation
intellij-openshift-connector copied to clipboard

current namespace is "default" and child errors "Missing namespace" even though it's not missing

Open adietish opened this issue 11 months ago • 0 comments

Steps:

  1. ASSERT: use minikube
  2. EXEC: apply the following RBAC rules
kubectl apply -f -
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  namespace: default
  name: can-read-pods
rules:
  - apiGroups: [""]
    resources: ["pods"]
    verbs: ["get", "watch", "list"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: read-pods
  namespace: default
subjects:
  - kind: User
    name: user1
    apiGroup: rbac.authorization.k8s.io
roleRef:
  kind: ClusterRole
  name: can-read-pods
  apiGroup: rbac.authorization.k8s.io
  1. EXEC: create a new user context and switch to it
openssl req -new -key user1.key -out user1.csr -subj "/CN=user1/O=group1"
openssl x509 -req -in user1.csr -CA ~/.minikube/ca.crt -CAkey ~/.minikube/ca.key -CAcreateserial -out user1.crt -days 500
kubectl config set-credentials user1 --client-certificate=user1.crt --client-key=user1.key
kubectl config set-context user1-context --cluster=minikube --user=user1
kubectl config use-context user1-context

Result: Resource tree erroneously shows "default" as current namespaces and "Missing namespace" at the same time. image

adietish avatar Mar 18 '24 15:03 adietish