refactor(*): update error message

Signed-off-by: Pavel Eremeev <selslack@users.noreply.github.com>
pull/5460/head
Pavel Eremeev 7 years ago
parent bc85db3a19
commit 535f9cece5

@ -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) {
} }
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 {

Loading…
Cancel
Save