gitlab provided $KUBECONFIG in ci is not following $KUBE_NAMESPACE
<!--- Please read this! Before opening a new issue, make sure to search for keywords in the issues filtered by the "regression" or "bug" label. For the Community Edition issue tracker: - https://gitlab.com/gitlab-org/gitlab-ce/issues?label_name%5B%5D=regression - https://gitlab.com/gitlab-org/gitlab-ce/issues?label_name%5B%5D=bug For the Enterprise Edition issue tracker: - https://gitlab.com/gitlab-org/gitlab-ee/issues?label_name%5B%5D=regression - https://gitlab.com/gitlab-org/gitlab-ee/issues?label_name%5B%5D=bug and verify the issue you're about to submit isn't a duplicate. ---> ### Summary kubernetes account provided in KUBECONFIG is not in the right namespace when setting namespace with KUBE_NAMESPACE in CI settings ### Steps to reproduce Add a RBAC enabled kubernetes cluster to your project Set up $KUBE_NAMESPACE to whatever existing namespace in your kubernetes cluster. ![image](/uploads/f6f20064ea5023e2848821369dfda782/image.png) set up a CI stage with an environment : ![image](/uploads/4f846a70c3983b78a7d8efca385611c1/image.png) and try to apply a file in the cluster : kubectl apply -f ./file.yml --namespace $KUBE_NAMESPACE ### What is the current *bug* behavior? ![image](/uploads/a4f09ca84aa055b50c62174ec2991f70/image.png) user provided in $KUBECONFIG has no edit right in the $KUBE_NAMESPACE ![image](/uploads/359ef325941beca75b293a176bc0fbc6/image.png) and $KUBECONFIG content : ![image](/uploads/61f037b34df256a507ca2212baa657ac/image.png) ### What is the expected *correct* behavior? ![image](/uploads/3fa14c110bc8744f92df94a4dad693c5/image.png) namespace should be $KUBE_NAMESPACE and this token should have edit rights in $KUBE_NAMESPACE ### Relevant logs and/or screenshots see previous screenshots ### Output of checks This bug happens on GitLab.com #### Results of GitLab environment info This bug happens on GitLab.com #### Results of GitLab application Check This bug happens on GitLab.com ### Possible fixes
issue