kconnect icon indicating copy to clipboard operation
kconnect copied to clipboard

cannot modify kube context using kubectl to change the default namespace in the context

Open kishoregv opened this issue 3 years ago • 6 comments

Describe the solution you'd like: When running kubectl/kubens command to change the default namespace to something else an error is thrown.

kubectl config set-context --namespace kube-public --current 
error: converting  to : type names don't match (Unknown, RawExtension), and no conversion 'func (runtime.Unknown, runtime.RawExtension) error' registered.

kubens kube-public
error: converting  to : type names don't match (Unknown, RawExtension), and no conversion 'func (runtime.Unknown, runtime.RawExtension) error' registered.
error getting current namespace

Why do you want this feature: It will be convenient to skip namespace flag to every kubectl command by allowing to modify the default namespace in the current kube context

kishoregv avatar Oct 05 '20 11:10 kishoregv

Thanks for raising this @kishoregv .

What version of kubectl are you using?

richardcase avatar Oct 05 '20 15:10 richardcase

I am able to run kubectl config set-context --namespace kube-public --current without getting the error. I will try kubens

richardcase avatar Oct 05 '20 15:10 richardcase

kubectl version

k version --short
Client Version: v1.16.0

kishoregv avatar Oct 06 '20 10:10 kishoregv

@kishoregv - i have done some testing and this is an issue with clients prior to v1.17.0. If you use kubectl (or anything that relies on client-go) from 1.17.0 onwards this will work.

richardcase avatar Oct 06 '20 17:10 richardcase

@kishoregv @rajarajanpsj - do you think we should do a version check within kconnect? Perhaps we could have a kconnect doctor or somethign similar that checks things like that?

richardcase avatar Oct 06 '20 17:10 richardcase

This should be handled by #222 and #223

richardcase avatar Jan 06 '21 11:01 richardcase