Giter Site home page Giter Site logo

Comments (4)

andreafalzetti avatar andreafalzetti commented on May 25, 2024

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:

  1. 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.
  2. 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.

ifbyol avatar ifbyol commented on May 25, 2024

@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.

rlamana avatar rlamana commented on May 25, 2024

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.

github-actions avatar github-actions commented on May 25, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.