From 4886909e538507fcbe9d759adc9d8d30f7241232 Mon Sep 17 00:00:00 2001 From: Jared Allard Date: Wed, 23 May 2018 16:02:54 -0700 Subject: [PATCH 1/2] fix(kube): make state miss not a error This is a partial shot in the dark currently, but this appears to be what's causing the deployment issues. I've been able to reproduce this issue quite frequently in multiple different environments and across helm versions, so, from the looks of this this should resolve it. Open to any feedback on a better way of handling this. Ideally since this appears to be just checking the internal state and seeing if it exists, we should be able to ignore that and instead make it a warning. I'll adjust the code as needed based on usage tests. Fixes #1193 --- pkg/kube/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/kube/client.go b/pkg/kube/client.go index 926174ef1..59cddff37 100644 --- a/pkg/kube/client.go +++ b/pkg/kube/client.go @@ -277,7 +277,7 @@ func (c *Client) Update(namespace string, originalReader, targetReader io.Reader originalInfo := original.Get(info) if originalInfo == nil { kind := info.Mapping.GroupVersionKind.Kind - return fmt.Errorf("no %s with the name %q found", kind, info.Name) + c.Log("Warning: no %s with the name %q found in internal state", kind, info.Name) } if err := updateResource(c, info, originalInfo.Object, force, recreate); err != nil { From ad546f16d55c7abb6328e507dd0214fca1855e67 Mon Sep 17 00:00:00 2001 From: Jared Allard Date: Wed, 30 May 2018 18:10:50 -0700 Subject: [PATCH 2/2] fix(pkg/kube): update with existing object if not in state --- pkg/kube/client.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/kube/client.go b/pkg/kube/client.go index 59cddff37..7496dca8b 100644 --- a/pkg/kube/client.go +++ b/pkg/kube/client.go @@ -278,6 +278,9 @@ func (c *Client) Update(namespace string, originalReader, targetReader io.Reader if originalInfo == nil { kind := info.Mapping.GroupVersionKind.Kind c.Log("Warning: no %s with the name %q found in internal state", kind, info.Name) + + originalInfo = &resource.Info{} + originalInfo.Object = info.Object } if err := updateResource(c, info, originalInfo.Object, force, recreate); err != nil {