rancher / dashboard

The Rancher UI
https://rancher.com
Apache License 2.0
463 stars 263 forks source link

Descriptions are not seen on apps #3038

Closed aaronyeeski closed 3 years ago

aaronyeeski commented 3 years ago

What kind of request is this (question/bug/enhancement/feature request): Bug

Steps to reproduce (least amount of steps as possible): On Rancher master-head version d8acb21, navigate to dashboard > apps & marketplace > charts Install an app (OPA gatekeeper 3.3.1+up3.3.0 was used to test). Add a description. Install.

Result: Description is not seen in app view. Or in app edit. Adding a description during app edit succeeds in the logs: helm upgrade --description=test2 --history-max=5 --install=true --namespace=cattle-gatekeeper-system --timeout=10m0s --values=/home/shell/helm/values-rancher-gatekeeper-3.3.1-up3.3.0.yaml --version=3.3.1+up3.3.0 --wait=true rancher-gatekeeper /home/shell/helm/rancher-gatekeeper-3.3.1-up3.3.0.tgz But is not seen in the UI or on app edit.

This behavior is also seen in v2.5.8

richard-cox commented 3 years ago

It doesn't seem like the description is accessible again, have asked the backend team.

For v1/catalog.cattle.io.clusterrepos/<repo>?action=install POST we set the description via charts[x].description (this looks like it's correct - https://github.com/rancher/rancher/blob/692a9507ebeec70118aa8496999e89d0dfa1cc18/pkg/api/steve/catalog/types/rest.go#L12). This is then visible in the log output as helm install ... --description=<description>. When fetching the resulting app from v1/catalog.cattle.io.apps I only see spec.chart.metadata.description of the original chart.. not what we've supplied.

jiaqiluo commented 3 years ago

Based on my investigation in rancher:v2.5.9-rc3, it looks like the UI is looking at the wrong place.

The charts[x].description is the correct field to set the description in the POST request.

But when fetching the resulting app from v1/catalog.cattle.io.apps, the UI should look up the value at data[*].spec.info.description. See the following screenshot as an example:

Screen Shot 2021-06-25 at 2 24 51 PM

@richard-cox I move this issue back to the UI team. Let me know if you have any questions. @aaronRancher We will need to backport the fix to Rancher v2.5.x.

richard-cox commented 3 years ago

@jiaqiluo It looks like spec.info.description is dependent on the state of the app and only updates to the user supplied description once successfully installed. I've seen it change from

image to image

If the install/upgrade is in progress or fails it gets stuck with the state description

image

It's good to how some kind of state message, however the user supplied state should still be retrievable

(If it helps with testing for the in progress/failed case I was using console from the repo https://cloudfoundry.github.io/stratos. It requires a default storage class in the cluster and none was configured causing installs/upgrades to fail)

jiaqiluo commented 3 years ago

I talked offline with @richard-cox, and his concern is that if the user edits the app again when the app is in the upgrading state, the user will end up editing the status text instead of their own description.

I feel it might be a bug in the backend that the spec.info.description is updated to reflect the app's state wrongly.

I need to do some investigation and will update my comment here.

jiaqiluo commented 3 years ago

Ok, I think this is not a bug, let me explain it here:

The purpose of the description is to provide an optional description of a Helm operation, such as helm install, helm uninstall, or helm upgrade. We can find it from Helm's help:

> helm install -h  | grep -i description
      --description string           add a custom description

and the only place we can see the description is in the history of an app:

> helm history rancher-backup -n cattle-resources-system
REVISION    UPDATED                     STATUS      CHART                               APP VERSION DESCRIPTION
1           Tue Jul  6 17:54:41 2021    superseded  rancher-backup-2.0.0+up2.0.0-rc3    2.0.0-rc3   insall-the-app-from-rancher-UI
2           Tue Jul  6 17:55:56 2021    deployed    rancher-backup-2.0.0+up2.0.0-rc3    2.0.0-rc3   edit to upgrade from Rancher UI

Therefore, back to this issue:

@aaronRancher @richard-cox I will close this issue for now. Let me know if you have any questions.

cbron commented 3 years ago

Reopening because I want to better understand the problem. @aaronRancher How did this work in 2.5.2 ? It sounds like what should happen is that the description can get added and edited and it resets every time, and the UI would display that. So how is 2.5.8 working differently than 2.5.2.

richard-cox commented 3 years ago

@jiaqiluo @cbron I have a feeling this has never worked, or at least is currently being presented incorrectly. If the description is only ever linked to the execution of the helm command then we need to move the context of the description field away from where it is now (implies it's more of a resource description) to somewhere more helm command specific (there's a helm options step which contains other fields like this).

aaronyeeski commented 3 years ago

@cbron This behavior is similar on Rancher v2.5.2 Helm upgrade succeeds with description.

SUCCESS: helm upgrade --description=test description --install=true --namespace=cattle-gatekeeper-system --timeout=10m0s --values=/home/shell/helm/values-rancher-gatekeeper-3.1.101.yaml --version=3.1.101 --wait=true rancher-gatekeeper /home/shell/helm/rancher-gatekeeper-3.1.101.tgz

Description is seen in YAML:

info:
    description: test description

Description is not seen in UI app view or app edit.

jiaqiluo commented 3 years ago

@jiaqiluo @cbron I have a feeling this has never worked, or at least is currently being presented incorrectly. If the description is only ever linked to the execution of the helm command then we need to move the context of the description field away from where it is now (implies it's more of a resource description) to somewhere more helm command specific (there's a helm options step which contains other fields like this).

@richard-cox I think you are right! Can you make a new UI issue for UI enhancement that just likes what you described? Once you create the new issue, can you link it to and close this one?

richard-cox commented 3 years ago

@jiaqiluo This is a good issue to track the problem with, I've created #3437 which will resolve it

deniseschannon commented 3 years ago

There is no more description field on app deployments, but honestly I'm not sure what the point is having description as a helm command if it doesn't get saved from version to version.

But this bug is no longer seen.