diff --git a/CHANGELOG.md b/CHANGELOG.md index ac5cb2847c..e70079d8c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## Unreleased - Fix DiffConfig issue when when provider's kubeconfig is set to file path (https://github.com/pulumi/pulumi-kubernetes/pull/2771) +- Fix for replacement having incorrect status messages (https://github.com/pulumi/pulumi-kubernetes/pull/2810) ## 4.7.1 (January 17, 2024) diff --git a/provider/pkg/await/await.go b/provider/pkg/await/await.go index 479161b685..a4a520a322 100644 --- a/provider/pkg/await/await.go +++ b/provider/pkg/await/await.go @@ -276,6 +276,7 @@ func Creation(c CreateConfig) (*unstructured.Unstructured, error) { if waitErr != nil { return nil, waitErr } + _ = clearStatus(c.Context, c.Host, c.URN) } } } else { @@ -333,13 +334,14 @@ func Read(c ReadConfig) (*unstructured.Unstructured, error) { if waitErr != nil { return nil, waitErr } + _ = clearStatus(c.Context, c.Host, c.URN) } } + } else { + logger.V(1).Infof( + "No read logic found for object of type %q; falling back to retrieving object", id) } - logger.V(1).Infof( - "No read logic found for object of type %q; falling back to retrieving object", id) - // If the client fails to get the live object for some reason, DO NOT return the error. This // will leak the fact that the object was successfully created. Instead, fall back to the // last-seen live object. @@ -415,6 +417,7 @@ func Update(c UpdateConfig) (*unstructured.Unstructured, error) { if waitErr != nil { return nil, waitErr } + _ = clearStatus(c.Context, c.Host, c.URN) } } } else { @@ -773,6 +776,10 @@ func Deletion(c DeleteConfig) error { }, clientForResource: client, }) + if waitErr != nil { + return waitErr + } + _ = clearStatus(c.Context, c.Host, c.URN) } } else { for { @@ -824,7 +831,7 @@ func Deletion(c DeleteConfig) error { } } - return waitErr + return nil } // deleteResource deletes the specified resource using foreground cascading delete.