Commit 535f9cec authored by Pavel Eremeev's avatar Pavel Eremeev

refactor(*): update error message

Signed-off-by: 's avatarPavel Eremeev <selslack@users.noreply.github.com>
parent bc85db3a
...@@ -334,11 +334,14 @@ func (c *Client) Update(namespace string, originalReader, targetReader io.Reader ...@@ -334,11 +334,14 @@ func (c *Client) Update(namespace string, originalReader, targetReader io.Reader
originalInfo := original.Get(info) originalInfo := original.Get(info)
// Resource exists in the current cluster state, but not in the current helm configuration // The resource already exists in the cluster, but it wasn't defined in the previous release.
// See: https://github.com/helm/helm/issues/1193 for more info // 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.
//
// See https://github.com/helm/helm/issues/1193 for more info.
if originalInfo == nil { if originalInfo == nil {
return fmt.Errorf( return fmt.Errorf(
"%s %q is not managed by Helm; delete the resource from the current cluster state to let Helm manage it", "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",
info.Mapping.GroupVersionKind.Kind, info.Mapping.GroupVersionKind.Kind,
info.Name, info.Name,
) )
......
...@@ -253,7 +253,7 @@ func TestUpdateNonManagedResourceError(t *testing.T) { ...@@ -253,7 +253,7 @@ func TestUpdateNonManagedResourceError(t *testing.T) {
} }
if err := c.Update(v1.NamespaceDefault, objBody(&current), objBody(&target), false, false, 0, false); err != nil { if err := c.Update(v1.NamespaceDefault, objBody(&current), objBody(&target), false, false, 0, false); err != nil {
if err.Error() != "Pod \"starfish\" is not managed by Helm; delete the resource from the current cluster state to let Helm manage it" { if err.Error() != "kind Pod with the name \"starfish\" 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" {
t.Fatal(err) t.Fatal(err)
} }
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment