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: Helm values not correctly reported #3621

Closed
dud225 opened this issue Oct 20, 2021 · 4 comments · Fixed by #3898
Closed

UI: Helm values not correctly reported #3621

dud225 opened this issue Oct 20, 2021 · 4 comments · Fixed by #3898
Assignees
Labels
component/ui Issue related to kubeapps UI good first issue kind/bug An issue that reports a defect in an existing feature
Projects

Comments

@dud225
Copy link
Contributor

dud225 commented Oct 20, 2021

Hello

I've initially deployed Kubeapps with a long Helm command that happened to add some Nginx annotations:

--set ingress.annotations."nginx\.ingress\.kubernetes\.io/auth-response-headers"=Authorization \
--set ingress.annotations."nginx\.ingress\.kubernetes\.io/auth-signin"='https://$host/oauth2/start?rd=$escaped_request_uri' \
--set ingress.annotations."nginx\.ingress\.kubernetes\.io/auth-url"=http://oauth2-proxy.kube-system.svc.cluster.local/oauth2/auth \
--set ingress.annotations."nginx\.ingress\.kubernetes\.io/configuration-snippet"='rewrite ^(/kubeapps)$ $1/ redirect;' \
--set ingress.annotations."nginx\.ingress\.kubernetes\.io/rewrite-target"='/$upstream_path' \

However those settings are not correctly reported within Kubeapps:
Capture d’écran de 2021-10-20 09-50-16

which makes it unhappy when deploying:
Capture d’écran de 2021-10-20 09-50-40

Manually adjusting the values in the UI allows the deployment to succeed.

@antgamdia
Copy link
Contributor

Hi Hervé, thanks for reporting it. I'll have a look using the current version in the main branch (as we performed some changes in the AppUpgrade view). However, it could be an actual issue derived from the parsing from yaml <-> json, so it is worth checking.

@antgamdia antgamdia added this to Inbox in Kubeapps Oct 25, 2021
@antgamdia
Copy link
Contributor

antgamdia commented Oct 25, 2021

Confirming it's an issue we can reproduce. I guess it is something wrong with the parser at one of the ends. Thanks again for letting us know :)

The problematic snippet should be either:

a) Using curly braces BUT with quoted values.

  annotations:
    {
      kubernetes.io/ingress.class: nginx,
      nginx.ingress.kubernetes.io/auth-response-headers: "Authorization",
      nginx.ingress.kubernetes.io/auth-signin: "https://$host/aaa/start?rd=$escaped_request_uri",
      nginx.ingress.kubernetes.io/auth-url: "http://aaa-proxy.kube-system.svc.cluster.local/oauth2/auth",
      nginx.ingress.kubernetes.io/configuration-snippet: "rewrite ^(/aaa)$ $1/ redirect;",
      nginx.ingress.kubernetes.io/rewrite-target: "/$upstream_path"
    }

or

b) not using curly braces at all

  annotations:
      kubernetes.io/ingress.class: nginx,
      nginx.ingress.kubernetes.io/auth-response-headers: Authorization,
      nginx.ingress.kubernetes.io/auth-signin: https://$host/aaa/start?rd=$escaped_request_uri,
      nginx.ingress.kubernetes.io/auth-url: http://aaa-proxy.kube-system.svc.cluster.local/oauth2/auth,
      nginx.ingress.kubernetes.io/configuration-snippet: rewrite ^(/aaa)$ $1/ redirect;,
      nginx.ingress.kubernetes.io/rewrite-target: /$upstream_path

I'd say the issue is around https://github.com/kubeapps/kubeapps/blob/master/dashboard/src/components/UpgradeForm/UpgradeForm.tsx#L107, but I don't have the bandwidth to closely look at it at the moment.

After looking into it a little bit, I'd say it is caused by the usage of two different YAML parsers in the frontend: js-yaml and yaml, so there could be some little differences in the implementation leading to this error.

An ugly and quick hotfix is replacing:
https://github.com/kubeapps/kubeapps/blob/30ced3aacf4b274f07fbf84d3b7d0691c6be4367/dashboard/src/components/UpgradeForm/UpgradeForm.tsx#L39

with:

  return values.replaceAll("{", "")?.replaceAll("}", "");

If anyone is interested in giving it a try, I'm happy to walk them through it.

@antgamdia antgamdia added component/ui Issue related to kubeapps UI kind/bug An issue that reports a defect in an existing feature priority/high good first issue labels Oct 25, 2021
@antgamdia antgamdia moved this from Inbox to Backlog in Kubeapps Oct 25, 2021
@castelblanque castelblanque moved this from Backlog to In progress in Kubeapps Dec 2, 2021
@castelblanque castelblanque self-assigned this Dec 2, 2021
castelblanque pushed a commit that referenced this issue Dec 3, 2021
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
castelblanque pushed a commit that referenced this issue Dec 3, 2021
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
castelblanque pushed a commit that referenced this issue Dec 9, 2021
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
castelblanque pushed a commit that referenced this issue Dec 9, 2021
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
castelblanque pushed a commit that referenced this issue Dec 9, 2021
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
Kubeapps automation moved this from In progress to Done Dec 9, 2021
castelblanque added a commit that referenced this issue Dec 9, 2021
* Wrong Helm values reported on Update form (#3621)

Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>

* Prettified code (#3621)

Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>

* Test fixes for double quotes on modified Helm chart values (#3621)

Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>

* Prettified strings on tests (#3621)

Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>

* Removed unnecessary scaping (#3621)

Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
@castelblanque castelblanque reopened this Mar 7, 2022
@castelblanque
Copy link
Collaborator

Reopening issue as stated here by a user.
Installation values appear unquoted in the Upgrade screen Yaml edition.

@castelblanque castelblanque moved this from Done to Inbox in Kubeapps Mar 7, 2022
@ppbaena ppbaena moved this from Inbox to Committed in Kubeapps Mar 15, 2022
@castelblanque
Copy link
Collaborator

User confirmed that after upgrade to package version 7.8.10 the issue is gone.
Closing as there is no actual issue now.

Kubeapps automation moved this from Committed to Done Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/ui Issue related to kubeapps UI good first issue kind/bug An issue that reports a defect in an existing feature
Projects
No open projects
Kubeapps
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants