-
Notifications
You must be signed in to change notification settings - Fork 115
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
Resource undergoing replacement has incorrect status messages #2810
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is one bit here (and associated return) where it's not immediately obvious to a tired reader that control flow is not changing, and this is just a logging change, however I think that's still the case, it's not changing, localizing error handling to make the code better.. Appreciate eyes on this :) |
||
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. | ||
|
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.
Nit: what I've seen at Pulumi before for intentionally ignoring errors is: