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

namespace selector has inconsistent refresh/resize behavior #10566

Open
tgross opened this issue May 11, 2021 · 5 comments
Open

namespace selector has inconsistent refresh/resize behavior #10566

tgross opened this issue May 11, 2021 · 5 comments

Comments

@tgross
Copy link
Member

tgross commented May 11, 2021

While doing some testing of Nomad 1.1.0-beta, I found some small papercuts in the refresh/resize behavior for the new namespace selector drop-down. Nothing I'd consider a show-stopper for release, so marking these for roadmapping. cc'ing @backspace just so you have visibility.

Without ACLs or namespaces, the selector is missing just as expected:

Screen Shot 2021-05-11 at 11 20 25 AM

Then if I add a namespace with nomad namespace apply dev, I have to do a full page refresh before the selector shows up:

Screen Shot 2021-05-11 at 11 20 44 AM

Next let's test it with ACLs:

  • delete the namespace nomad namespace delete dev
  • add acls { enabled = true } to the config
  • nomad acl bootstrap and set the NOMAD_TOKEN environment variable to the root token (don't lose the root token, we'll need it in a bit)
  • apply the policy below: nomad acl policy apply dev-reader policy.hcl
  • generate a new token: nomad acl token create -name reader -policy=dev-reader, and set the NOMAD_TOKEN environment variable to the new token.
  • verify that nomad job status works and gives an empty result
policy.hcl
namespace "dev" {
  policy       = "read"
  capabilities = ["read-job", "list-jobs"]
}

Now auth to the web UI with nomad ui -authenticate. Because there is no dev namespace yet and we don't have access to the default namespace, it'll look like we're unauthorized, as I'd expect:

Screen Shot 2021-05-11 at 11 31 42 AM

If we then add the dev namespace with NOMAD_TOKEN=<root token> nomad namespace apply dev, the selector will not refresh. After a page refresh, we're still on the default namespace we don't have access to (as expected?) but that results in the selector looking like this:

Screen Shot 2021-05-11 at 11 33 16 AM

Click on the caret, and we get this unfortunate looking drop-down:

Screen Shot 2021-05-11 at 11 33 23 AM

But then once we make the selection, it looks as expected:

Screen Shot 2021-05-11 at 11 33 27 AM

@backspace
Copy link
Contributor

hah that tiny menu is quite the thing. Thanks for documenting all this!

There’s a @watchAll('namespace') that I’d think would catch a new namespace being added but maybe shouldShowNamespaces isn’t recalculating like it should 🤔

@tgross
Copy link
Member Author

tgross commented Jun 16, 2021

Related #10769

@gowthamgts
Copy link
Contributor

can we also have "All" as the default namespace in the dropdown, instead of the default namespace if we have multiple namespaces?

@tgross
Copy link
Member Author

tgross commented Jul 8, 2021

@gowthamgts just a head up that's intentional -- the * option is an expensive query against the server so we default to default instead. But in any case, if you'd like to discuss that further it'd probably be better to open a new feature request rather than having the discussion in this bug report.

@gowthamgts
Copy link
Contributor

@tgross - created one - #10871

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

No branches or pull requests

3 participants