-
Notifications
You must be signed in to change notification settings - Fork 102
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
No panic when getting a plan status for an instance with no plan #461
Conversation
In certain edge case situations (like a controller outage) an instance might not have an `activePlan.status` set. This fixes a cli panic when querying a plan status for such an instance. Issues: #459
@@ -621,3 +622,8 @@ func (r *ReconcilePlanExecution) Cleanup(obj runtime.Object) error { | |||
|
|||
return nil | |||
} | |||
|
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.
This is unrelated to the bug, just making our lives easier when debugging integration tests.
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.
nice work. I have a strong preference to move prettyPrint
to be a util outside of planexec... but this is a great improvement.
func prettyPrint(i interface{}) string { | ||
s, _ := json.MarshalIndent(i, "", " ") | ||
return string(s) | ||
} |
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.
shouldn't this be in a json util package? this is not planexec specific
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.
as I reason through this more... this function literal swallows the err. what is the output for an error? do we not want any indication there was an error?
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.
That's why I haven't put it into util package - I didn't want a general purpose prettyPrint method for everybody (though it can be). So far, I only saw planexecution_controller
printing gigantic yaml object in our logs.
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.
Nice 🕵 work! :)
In certain edge case situations (like a controller outage) an instance might not have an `activePlan.status` set. This fixes a cli panic when querying a plan status for such an instance. Issues: #459
What type of PR is this?
/kind bug
What this PR does / why we need it:
In certain edge case situations (like a controller outage) an instance might not have an
activePlan.status
set. This fixes a cli-panic when querying a plan status for such an instance.Which issue(s) this PR fixes:
Fixes #459
Special notes for your reviewer:
Does this PR introduce a user-facing change?: