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

kubectl-mayastor: use namespace from current context #1575

Open
b-thiswatch opened this issue Jan 9, 2024 · 7 comments
Open

kubectl-mayastor: use namespace from current context #1575

b-thiswatch opened this issue Jan 9, 2024 · 7 comments
Assignees
Labels
kind/improvement Categorizes issue or PR as related to improving upon a current feature

Comments

@b-thiswatch
Copy link

b-thiswatch commented Jan 9, 2024

Describe the bug
When using the plugin, it currently ignores the namespace from current context. You have to use -n

To Reproduce
Install mayastor in namespace not mayastor, like "openebs" e.g.
Running kubectl mayastor get volumes will fail, even when current context has the correct namespace (with kubie for example)

Expected behavior
use the context :)

@b-thiswatch b-thiswatch added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one label Jan 9, 2024
@tiagolobocastro
Copy link
Contributor

What should the behaviour be like?
For example, we default to the mayastor namespace so that users don't have to specify -n mayastor. If we take the namespace from context, then which one to use at any given time?

Potential approaches:

  1. If no rest is found on given namespace, try the context?
  2. If context is not "default" then always use context
  3. Don't default to mayastor, just use whatever the context has.

I'd probably lean towards 2 or 3, perhaps 2. Open to comments here.

@tiagolobocastro tiagolobocastro added kind/improvement Categorizes issue or PR as related to improving upon a current feature and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one labels Jan 20, 2024
@dsharma-dc
Copy link
Contributor

If context is not "default" then always use context

Is this identifiable cleanly? context name can be potentially anything.

3 seems reasonable. Don't default to mayastor, just use whatever the context has, IF it has any namespace explicitly mentioned

@Abhinandan-Purkait
Copy link
Member

What should the behaviour be like? For example, we default to the mayastor namespace so that users don't have to specify -n mayastor. If we take the namespace from context, then which one to use at any given time?

Potential approaches:

  1. If no rest is found on given namespace, try the context?
  2. If context is not "default" then always use context
  3. Don't default to mayastor, just use whatever the context has.

I'd probably lean towards 2 or 3, perhaps 2. Open to comments here.

I think 3 would be the best way here, as the one set to the context is usually deemed to be default for that context, so we can go with that, instead of using mayastor as hardcoded default?

@tiagolobocastro
Copy link
Contributor

Is this identifiable cleanly? context name can be potentially anything.

Yes I think we'd use current context and also take optional context name.
This might require modifying e2e tests, CC @blaisedias

@tiagolobocastro
Copy link
Contributor

Also this is also a breaking change for the users, if they were not specifying the namespace and have code/scripts :(

@tiagolobocastro
Copy link
Contributor

I've discussed this with @niladrih and here's the proposal:
Implement 3, but default to 2 (using cli arg or env)
When we move mayastor to v3 then we can remove the cli arg/env, and default to 3.

@tiagolobocastro tiagolobocastro added this to the OpenEBS v4.2 milestone Oct 10, 2024
@avishnu avishnu removed this from the OpenEBS v4.2 milestone Jan 8, 2025
@avishnu avishnu added this to the Mayastor v2.8 milestone Jan 17, 2025
@avishnu avishnu moved this from Done to In Progress in OpenEBS Roadmap Tracking Jan 30, 2025
@avishnu
Copy link
Member

avishnu commented Jan 30, 2025

Code changes are made as per openebs/mayastor-extensions#608, however, making this behaviour default will be done as part of next major release of Mayastor.

@avishnu avishnu removed this from the Mayastor v2.8 milestone Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/improvement Categorizes issue or PR as related to improving upon a current feature
Projects
Status: In Progress
Development

No branches or pull requests

8 participants