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

Removing values in the YAML editor during chart installation sends null values to the backend #13164

Open
momesgin opened this issue Jan 20, 2025 · 5 comments
Labels
area/apps kind/bug QA/dev-automation Issues that engineers have written automation around so QA doesn't have look at this

Comments

@momesgin
Copy link
Member

momesgin commented Jan 20, 2025

Internal Reference: SURE-8554

Describe the bug

During a chart installation you have the option to alter the configuration by using the YAML editor. Since UI will send only the altered values to the backend, if you remove a value the UI will send it as null. But the helm cli works differently when you provide a local values file, the settings configured in the file are merged with the default values, anything that is not set, does not alter the defaults.

Here is an example of the values that would be sent to the backend, if you add a value like pullSecrets:

            "values": {
                "image": {
                    "pullSecrets": [
                        "application-collection"
                    ]
                },
                "global": {
                    "cattle": {
                        "clusterId": "local",
                        "clusterName": "local",
                        "systemProjectId": "p-8779h",
                        "url": "https://localhost:8443",
                        "rkePathPrefix": "",
                        "rkeWindowsPathPrefix": ""
                    }
                }
            }

But if you remove everything else and only send the image pullSecrets the payload will look like this:

"values": {
                "image": {
                    "pullSecrets": [
                        "application-collection"
                    ],
                    "pullPolicy": null,
                    "repository": null,
                    "tag": null
                },
                "adminUser": {
                    "bucket": null,
                    "organization": null,
                    "password": null,
                    "retention_policy": null,
                    "token": null,
                    "user": null
                },
                "fullnameOverride": null,
                "ingress": {
                    "enabled": null,
                    "hostname": null,
                    "path": null,
                    "tls": null
                },
                "initScripts": {
                    "enabled": null,
                    "scripts": {
                        "init.sh": null
                    }
                },
                "nameOverride": null,
                "pdb": {
                    "create": null,
                    "minAvailable": null
                },
                "persistence": {
                    "accessMode": null,
                    "enabled": null,
                    "mountPath": null,
                    "size": null,
                    "subPath": null
                },
                "service": {
                    "port": null,
                    "portName": null,
                    "targetPort": null,
                    "type": null
                },
                "serviceAccount": {
                    "create": null,
                    "name": null
                },
                "startupProbe": {
                    "enabled": null
                },
                "tolerations": null,
                "global": {
                    "cattle": {
                        "clusterId": "local",
                        "clusterName": "local",
                        "systemProjectId": "p-8779h",
                        "url": "https://localhost:8443",
                        "rkePathPrefix": "",
                        "rkeWindowsPathPrefix": ""
                    }
                }
            }

To Reproduce

  • Authenticate with Application Collection and create a token
  • Add the secret to kubernetes in the target namespace as per the docs
  • Configure oci://dp.apps.rancher.io/charts in Apps > Repositories
  • Deploy any apps from AppCo from the Charts view with only the image.pullSecrets values

Result
Null values gets sent along with the new values.

Expected Result
Only the altered values should be sent(global object is expected to be sent when it's a chart from appco)

Additional context
As a workaround, delete the failed deployment and revert to using helm cli

@github-actions github-actions bot added the QA/dev-automation Issues that engineers have written automation around so QA doesn't have look at this label Jan 20, 2025
@richard-cox
Copy link
Member

Just ruling something out, can you confirm the chart/app version that's installed why you use the cli?

Intrigued about their docs too, the steps should be able to be shorted to do Add the secret to kubernetes in the target namespace as per the docs when creating the repo

@momesgin momesgin changed the title Installing chart fails in UI only Removing values in the YAML editor during chart installation sends null values to the backend Jan 21, 2025
@momesgin
Copy link
Member Author

momesgin commented Jan 21, 2025

@richard-cox Sorry, I think I should've captured the issue better in the description. I just updated the issue to reflect the main problem being discussed on the jira ticket.

I discussed this with @nwmac , and will also talk to @kwwii about the best possible UX solution.

Just ruling something out, can you confirm the chart/app version that's installed why you use the cli?

I'm not sure if I understand the question correctly

the steps should be able to be shorted to do Add the secret to kubernetes in the target namespace as per the docs when creating the repo

do you mean that if you run the below command in the target namespace, you won't need to add the pullSecrets manually for each chart installation?

kubectl create secret docker-registry application-collection --docker-server=dp.apps.rancher.io --docker-username=<your-username-or-sa-username> --docker-password=<access-token-or-sa-token>

@richard-cox
Copy link
Member

Thanks for clarifying

Just ruling something out, can you confirm the chart/app version that's installed why when you use the cli?

Fixed typo

do you mean that if you run the below command in the target namespace, you won't need to add the pullSecrets manually for each chart installation?

kubectl create secret docker-registry application-collection --docker-server=dp.apps.rancher.io --docker-username= --docker-password=

Interesting. I meant that in the create repo wizard the user can supply a secret to auth with the repo. Looking back that isn't applicable.

There's definitely a UX gap here though, specifically if all app collection charts require the pull secret chart value?

@momesgin
Copy link
Member Author

momesgin commented Jan 22, 2025

Just ruling something out, can you confirm the chart/app version that's installed when you use the cli?

I used the command that was mentioned on the jira ticket which installs the latest(2.1.2):

helm install my-influxdb oci://dp.apps.rancher.io/charts/influxdb --set 'image.pullSecrets[0]=application-collection'

Image\


There's definitely a UX gap here though, specifically if all app collection charts require the pull secret chart value?

yes, as far as I know the pull secret is required

Update: I asked Rohit from the Mapps team, and confirmed that pull secret is required for installing any apps from AppCo

@momesgin
Copy link
Member Author

@kwwii I created an ux issue for tracking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/apps kind/bug QA/dev-automation Issues that engineers have written automation around so QA doesn't have look at this
Projects
None yet
Development

No branches or pull requests

2 participants