-
Notifications
You must be signed in to change notification settings - Fork 7.5k
refactor(*): make "not found" error message user-friendly #5460
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
refactor(*): make "not found" error message user-friendly #5460
Conversation
Signed-off-by: Pavel Eremeev <selslack@users.noreply.github.com>
pkg/kube/client.go
Outdated
| kind := info.Mapping.GroupVersionKind.Kind | ||
| return fmt.Errorf("no %s with the name %q found", kind, info.Name) | ||
| return fmt.Errorf( | ||
| "%s %q is not managed by Helm; delete the resource from the current cluster state to let Helm manage it", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we please change the error message to
kind %s with the name %q already exists in the cluster and wasn't defined in the previous release. Before upgrading, please either delete the resource from the cluster or remove it from the chart.
This error can also occur if another chart is managing the resource, so "is not managed by Helm" is not always true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
pkg/kube/client.go
Outdated
|
|
||
| originalInfo := original.Get(info) | ||
|
|
||
| // Resource exists in the current cluster state, but not in the current helm configuration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change this to
The resource already exists in the cluster, but it wasn't defined in the previous release. In this case, we consider it to be a resource that was previously un-managed by the release and error out, asking for the user to intervene.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Signed-off-by: Pavel Eremeev <selslack@users.noreply.github.com>
What this PR does / why we need it:
Improved error message for users experiencing error described in #1193.
Special notes for your reviewer:
If applicable: