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

ui: Fix configuration when changing the basePath and fix permissions management in the navbar #3254

Merged
merged 6 commits into from
Apr 14, 2021

Conversation

JBWatenbergScality
Copy link
Contributor

@JBWatenbergScality JBWatenbergScality commented Mar 31, 2021

Component:

salt, ui

Context:

When deploying the UI on another path than / the shell-ui config couldn't be fetched.

Also this PR brings a fix for the shell-ui which was checking if the user have all the groups instead of a single one to enable access to an entry.

@JBWatenbergScality JBWatenbergScality requested a review from a team as a code owner March 31, 2021 18:28
@bert-e
Copy link
Contributor

bert-e commented Mar 31, 2021

Hello jbwatenbergscality,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Status report is not available.

@bert-e
Copy link
Contributor

bert-e commented Mar 31, 2021

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

@JBWatenbergScality JBWatenbergScality added topic:ui UI-related issues topic:salt Everything related to SaltStack in our product labels Mar 31, 2021
@ChengYanJin ChengYanJin changed the title salt: Fix UI path when deploying on another paht than / salt: Fix UI path when deploying on another path than / Mar 31, 2021
@ChengYanJin ChengYanJin changed the title salt: Fix UI path when deploying on another path than / salt: Fix UI path when deploying on another path than / Mar 31, 2021
@ChengYanJin ChengYanJin changed the title salt: Fix UI path when deploying on another path than / salt: Fix UI path when deploying on another path than / Mar 31, 2021
Copy link
Contributor

@gdemonet gdemonet left a comment

Choose a reason for hiding this comment

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

We also need to update the redirect URI in the Dex client configuration and in Shell UI configuration.

salt/metalk8s/addons/ui/deployed/ingress.sls Outdated Show resolved Hide resolved
salt/metalk8s/addons/ui/deployed/ingress.sls Outdated Show resolved Hide resolved
@bert-e
Copy link
Contributor

bert-e commented Apr 1, 2021

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

The following reviewers are expecting changes from the author, or must review again:

@JBWatenbergScality JBWatenbergScality force-pushed the bugfix/path-config branch 2 times, most recently from b080214 to a36d3af Compare April 2, 2021 07:36
@JBWatenbergScality JBWatenbergScality changed the title salt: Fix UI path when deploying on another path than / ui: Fix configuration when changing the basePath and fix permissions management in the navbar Apr 2, 2021
Copy link
Contributor

@gdemonet gdemonet left a comment

Choose a reason for hiding this comment

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

Only one thing blocking about leading/trailing slashes in Jinja templates, otherwise LGTM

salt/metalk8s/addons/ui/deployed/ui.sls.in Outdated Show resolved Hide resolved
salt/metalk8s/addons/dex/config/dex.yaml.j2 Outdated Show resolved Hide resolved
shell-ui/babel.config.js Show resolved Hide resolved
shell-ui/src/auth/permissionUtils.js Show resolved Hide resolved
@JBWatenbergScality JBWatenbergScality force-pushed the bugfix/path-config branch 4 times, most recently from 4e7166f to c3fc82c Compare April 6, 2021 11:55
CHANGELOG.md Show resolved Hide resolved
salt/metalk8s/addons/ui/deployed/ingress.sls Outdated Show resolved Hide resolved
gdemonet
gdemonet previously approved these changes Apr 8, 2021
@bert-e
Copy link
Contributor

bert-e commented Apr 8, 2021

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

@JBWatenbergScality
Copy link
Contributor Author

/approve

@bert-e
Copy link
Contributor

bert-e commented Apr 8, 2021

Build failed

The build for commit did not succeed in branch bugfix/path-config.

The following options are set: approve

@bert-e
Copy link
Contributor

bert-e commented Apr 9, 2021

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

The following options are set: approve

@@ -27,7 +27,7 @@ include:
%}

{%- set stripped_base_path = metalk8s_ui_config.spec.basePath.strip('/') %}
{%- set normalized_base_path = '/' ~ stripped_base_path if stripped_base_path else '' %}
{%- set normalized_base_path = '/' ~ stripped_base_path if stripped_base_path else '/' %}
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe a stupid comment, but isn't this equivalent to

{%- set normalized_base_path = '/' ~ stripped_base_path %}

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done, I squashed and took care of it at the same time

…{{ metalk8s_ui_config.spec.basePath }}/shell/config.json

As we have a nginx location rule on /shell/config.json in UI nginx, the path seen from there should be /shell/config.json instead of /{{ metalk8s_ui_config.spec.basePath }}/shell/config.json
Copy link
Contributor

@gdemonet gdemonet left a comment

Choose a reason for hiding this comment

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

:shipit:

@bert-e
Copy link
Contributor

bert-e commented Apr 14, 2021

Build failed

The build for commit did not succeed in branch bugfix/path-config.

The following options are set: approve

@bert-e
Copy link
Contributor

bert-e commented Apr 14, 2021

In the queue

The changeset has received all authorizations and has been added to the
relevant queue(s). The queue(s) will be merged in the target development
branch(es) as soon as builds have passed.

The changeset will be merged in:

  • ✔️ development/2.9

The following branches will NOT be impacted:

  • development/1.0
  • development/1.1
  • development/1.2
  • development/1.3
  • development/2.0
  • development/2.1
  • development/2.2
  • development/2.3
  • development/2.4
  • development/2.5
  • development/2.6
  • development/2.7
  • development/2.8

There is no action required on your side. You will be notified here once
the changeset has been merged. In the unlikely event that the changeset
fails permanently on the queue, a member of the admin team will
contact you to help resolve the matter.

IMPORTANT

Please do not attempt to modify this pull request.

  • Any commit you add on the source branch will trigger a new cycle after the
    current queue is merged.
  • Any commit you add on one of the integration branches will be lost.

If you need this pull request to be removed from the queue, please contact a
member of the admin team now.

The following options are set: approve

@bert-e
Copy link
Contributor

bert-e commented Apr 14, 2021

I have successfully merged the changeset of this pull request
into targetted development branches:

  • ✔️ development/2.9

The following branches have NOT changed:

  • development/1.0
  • development/1.1
  • development/1.2
  • development/1.3
  • development/2.0
  • development/2.1
  • development/2.2
  • development/2.3
  • development/2.4
  • development/2.5
  • development/2.6
  • development/2.7
  • development/2.8

Please check the status of the associated issue None.

Goodbye jbwatenbergscality.

@bert-e bert-e merged commit 852af4a into development/2.9 Apr 14, 2021
@bert-e bert-e deleted the bugfix/path-config branch April 14, 2021 12:12
gdemonet added a commit that referenced this pull request Apr 19, 2021
Adding a `rewrite-target` annotation is needed when the base path is not
/, because NGINX does not know where to find the documentation static
files.

We now always expose MetalK8s docs behind /docs, optionally appending
the configured base path for MetalK8s UI (e.g. /docs/platform).
This will avoid strange conflicts with the behaviour of the current
Ingress when running MetalK8s at a non-root path, because mixing regular
expressions and exact matches does not play well with ingress-nginx.

See: #3254
See: https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#use-regex
gdemonet added a commit that referenced this pull request Apr 20, 2021
Adding a `rewrite-target` annotation is needed when the base path is not
/, because NGINX does not know where to find the documentation static
files.

We now always expose MetalK8s docs behind /docs, optionally appending
the configured base path for MetalK8s UI (e.g. /docs/platform).
This will avoid strange conflicts with the behaviour of the current
Ingress when running MetalK8s at a non-root path, because mixing regular
expressions and exact matches does not play well with ingress-nginx.

See: #3254
See: https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#use-regex
gdemonet added a commit that referenced this pull request Apr 20, 2021
Adding a `rewrite-target` annotation is needed when the base path is not
/, because NGINX does not know where to find the documentation static
files.

We now always expose MetalK8s docs behind /docs, optionally appending
the configured base path for MetalK8s UI (e.g. /docs/platform).
This will avoid strange conflicts with the behaviour of the current
Ingress when running MetalK8s at a non-root path, because mixing regular
expressions and exact matches does not play well with ingress-nginx.

See: #3254
See: https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#use-regex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic:salt Everything related to SaltStack in our product topic:ui UI-related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants