Comments (4)
I can reproduce this behavior and I want to add extra info to explain what's happening.
Regardless if the user adds the vanilla k8s context to the okteto config (via okteto ctx use <context>
), the CLI detects k8s clusters by parsing the user .kube/config
. This means, that I have potentially N contexts that I don't have in my ~/.okteto/context/config.json
, so when I delete them, I don't really delete them because they were automatically discovered and added to the okteto ctx list
output.
You could add one explicitly by running okteto ctx use <context>
, which would add it to the Okteto config, however from a user's perspective, it's the same, because removing it would effectively remove it from our config, but it would be discovered automatically again when listing contexts.
The options that I see here are:
- Returning an error when attempting to delete a context that does not belong to the Okteto config (ie.
This context cannot be deleted because it was automatically discovered from yoru ~/.kube/config.
) Possibly inviting the user to update their kube config, if needed. Or potentially ask for confirmation, and update the kube config from the CLI. - Create a property in our config with the list of "deleted" vanilla clusters, so that we don't display them automatically. If the user adds the context again, we could remove it from this list, so it would appear agin.
from okteto.
@pchico83 @codyjlandstrom @rlamana I think we need to think about this from a product perspective. I agree the experience is odd for the customer as they might think that the command didn't work.
I think modifying the command help to highlight the fact that kubernetes contexts cannot be deleted and raising an error with a descriptive message when that scenarios happens would be the best option. I don't think we should write in the kubeconfig
from okteto.
Agree, we should fail and explain that kubernetes context cannot be deleted using okteto's CLI. Even, when doing okteto context list
or the okteto context
selector, we should indicate the distinction between this two types of context.
I also found another bug when doing okteto context list
if you previously delete the current context, that I reported here: #4144
from okteto.
This issue is stale because it has been open for 60 days with no activity. Comment on this issue or it will be closed in 7 days
from okteto.
Related Issues (20)
- 2000000
- 100000
- Add support for error hints in `okteto build` HOT 2
- Canβt add a variable with special characters using the launch environment deployment HOT 1
- Using `OKTETO_USE_STATIC_KUBETOKEN ` as an Okteto secret creates a dynamic kubetoken HOT 1
- Dev sessions get disconnected with "The server has asked for the client to provide credentials (get deployments.apps)` HOT 1
- Don't try to regenerate an expired API token HOT 1
- Can't use existing volume with new container HOT 1
- Is windows podman supported? HOT 1
- Remote okteto deploy broken when `var` has whitespace HOT 2
- Test
- Connection lost to your development container on starting debugging from PyCharm HOT 2
- Shadiibot
- `okteto context list` doesn't work if no context is selected, or right after running a `context delete` of current context HOT 1
- Publish okteto to winget HOT 2
- Running `okteto up` as a daemon HOT 2
- "okteto build" reports that service doesn't exist when it's not able to parse the okteto manifest HOT 1
- Running `okteto up --deploy` fails with nil pointer dereference in GithubActions pipeline HOT 2
- envFrom secrets are not available in hybrid mode HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from okteto.