Skip to content
This repository has been archived by the owner on Jan 19, 2023. It is now read-only.

Add --namespace-list flag to accept a slice of namespaces #928

Merged
merged 2 commits into from
May 20, 2020

Conversation

GuessWhoSamFoo
Copy link
Contributor

@GuessWhoSamFoo GuessWhoSamFoo commented May 10, 2020

What this PR does / why we need it:
Adds a --namespace-list flag which accepts a slice of namespaces in the form of x,y,z and validates each via Get rather than List for users who have restricted clusters.

Which issue(s) this PR fixes

@wwitzel3
Copy link
Contributor

I can't decide if we should just extend the --namespace flag to support invoking with a single value or a list or if we should add a new flag. I envisioned this extending --namespace

@GuessWhoSamFoo
Copy link
Contributor Author

The only benefit to setting this up as a separate flag is if a user wants to provide namespaces but not necessarily start octant on any of them. I don't think that merits a different flag - going to change this

@wwitzel3
Copy link
Contributor

Make sure we document that the first namespace becomes the initial/default namespace when Octant loads.

@GuessWhoSamFoo GuessWhoSamFoo force-pushed the issue-911 branch 2 times, most recently from 72c0228 to dea39b4 Compare May 12, 2020 03:24
@wwitzel3
Copy link
Contributor

Ok, sorry @GuessWhoSamFoo but now I'm leaning back towards a separate flag. When I start to think about how to document this flag, there ends up being too many AND/ORs in it and it gets a little muddy. I think you had it right the first time, but maybe we call it --namespace-list ? To help disambiguate it from --namespace.

--namespace - sets the startup namespaces.
--namespace-list - explicitly sets the namespaces Octant will provide in the namespace selector.

@GuessWhoSamFoo GuessWhoSamFoo force-pushed the issue-911 branch 2 times, most recently from 227f130 to e646b5d Compare May 15, 2020 15:58
Signed-off-by: GuessWhoSamFoo <foos@vmware.com>
@GuessWhoSamFoo
Copy link
Contributor Author

Rebased on master and changed flag name

Copy link
Contributor

@wwitzel3 wwitzel3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's get this better documented, something like.

a list of namespaces to make available, if not set, Octant will attempt to list namespaces from the cluster

changelogs/unreleased/928-GuessWhoSamFoo Outdated Show resolved Hide resolved
Signed-off-by: GuessWhoSamFoo <foos@vmware.com>
@GuessWhoSamFoo GuessWhoSamFoo changed the title Add --namespaces flag to accept a slice of namespaces Add --namespace-list flag to accept a slice of namespaces May 20, 2020
@GuessWhoSamFoo GuessWhoSamFoo merged commit a3c1626 into vmware-archive:master May 20, 2020
@GuessWhoSamFoo GuessWhoSamFoo deleted the issue-911 branch May 20, 2020 17:35
@merlindorin
Copy link

Top! thx

@tonyfalabella
Copy link

Can --namespace-list use wildcards? If not is it something you can add? Our company has many namespaces but for a given team all namespaces have a certain pattern.

I'd like to be able to use like this:
octant --namespace-list foo*,bar*,xyz

@GuessWhoSamFoo
Copy link
Contributor Author

That sounds like a reasonable request. Opened an issue for tracking

@merlindorin
Copy link

@GuessWhoSamFoo I'm not sure if it's a good idea.

Under the hood, --namespace-list provide a static namespace list (no rights on kubeAPI namespace list). With a feature like a wildcard... we will have to list all namespaces available (needs kubeAPI namespace list rights) and then we will apply a filter.

It will be hard for a user with no rights on kubeAPI namespace list to understand why --namespace-list foo-bar works and why --namespace-list foo-* does not.

Maybe it can be something like --namespace-filter ?

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

Successfully merging this pull request may close these issues.

Static namespace list
4 participants