Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle namespace flag in the same way for all the commands that allow it #2886

Open
ifbyol opened this issue Jul 4, 2022 · 1 comment
Open
Labels
Milestone

Comments

@ifbyol
Copy link
Member

ifbyol commented Jul 4, 2022

Is your feature request related to a problem? Please describe.
Several commands support the namespace flag and also the ability to specify the namespace through the manifest and we have different behaviors depending on the command.

For example, using the repository https://github.com/jmacelroy/go-getting-started.git, if I include a namespace property in the okteto.yml with the namespace new-ifbyol

  • When I execute okteto deploy -n ifbyol, the dev environment (empty) is deployed within new-ifbyol but the hello deployment is deployed within ifbyol namespace

Captura de Pantalla 2022-07-04 a las 11 58 17

Captura de Pantalla 2022-07-04 a las 11 58 25

  • When I execute okteto destroy -n ifbyol, I get an error The namespace in the okteto manifest doesn't match your namespace argument

Captura de Pantalla 2022-07-04 a las 11 59 24

Also, from a coding perspective, sometimes we are setting the Namespace specified in the options struct we usually create with the flags with the context namespace if the user didn't specify one and in other commands we are not doing that and create other struct with the real values for the command

Describe the solution you'd like
An homogeneous behavior of the Namespace flag. If the specified flag cannot be different to the one specified in the manifest, the deploy operation should fail as the destroy does.

Ideally, we should also follow the same convention when defined flags for the commands and then, how they are passed to the real command execution. We should probably decouple both and have an struct with all the specified flags for the user and then, have another different with the real values that will be used by the command (so the one specified by the user would override the default values without modifying any original value)

We should also review the behavior of the namespace flag in other commands to make sure it behaves correctly and we don't have this issue

Describe alternatives you've considered
N/A

Additional context
I think this would help to make things less error-prone

@github-actions
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants