Repository navigation
Fix improper use of Table request/response to k8s API - #11720
Merged
Merged
Conversation
Fixes helm#11712 A change was made that when validation was turned off the Kubernetes packages were building objects as a Table type. This was done for display purposes. When details about the objects was going to be printed as part of helm#10912. This broke rollback, and possibly other functionality, as a Table type was returned in some cases that needed the regular object. This caused things to break silently. The fix involved adding in a new Function (and interface) to query for tables instead of the objects themselves. There was not a clean way to add it to the existing function that covered all cases. A second problem was noticed along the way. When data was output via status as YAML or JSON it was in the form of a table rather than the objects themselves. This did not reflect expectations and did not match the functionality in kubectl. The code was updated to return a table when that was presented and the objects when they are being output for YAML or JSON. The API also supports this handling to SDK users can replicate this functionality. API changes made here were never released. The functions were developed for this release of Helm and only ever appeared in an RC. In this case, they can be changed. Signed-off-by: Matt Farina <[email protected]>
sabre1041
approved these changes
Jan 13, 2023
sabre1041
left a comment
Contributor
There was a problem hiding this comment.
Confirmed PR addresses issues with resources being clobbered as part of a rollback
hickeyma
reviewed
Jan 13, 2023
hickeyma
left a comment
Contributor
There was a problem hiding this comment.
@mattfarina Code reviewed, looks good. I need to do some manual testing. Will get to it shortly.
hickeyma
approved these changes
Jan 13, 2023
hickeyma
left a comment
Contributor
There was a problem hiding this comment.
Tested and fixes the rollback problem. Nice fix, thanks @mattfarina. Good to merge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A change was made that when validation was turned off the Kubernetes packages were building objects as a Table type. This was done for display purposes. When details about the objects was going to be printed as part of #10912.
This broke rollback, and possibly other functionality, as a Table type was returned in some cases that needed the regular object. This caused things to break silently.
The fix involved adding in a new Function (and interface) to query for tables instead of the objects themselves. There was not a clean way to add it to the existing function that covered all cases.
A second problem was noticed along the way. When data was output via status as YAML or JSON it was in the form of a table rather than the objects themselves. This did not reflect expectations and did not match the functionality in kubectl. The code was updated to return a table when that was presented and the objects when they are being output for YAML or JSON. The API also supports this handling to SDK users can replicate this functionality.
API changes made here were never released. The functions were developed for this release of Helm and only ever appeared in an RC. In this case, they can be changed.
Note, extensive testing is not covered by this PR as our testing system doesn't have the ability to cover this :(. The additional testing needs can be covered in follow-up pull requests.
Fixes #11712
What this PR does / why we need it: There is a regression in 3.11.0-rc.1 that needs to be fixed before release
Special notes for your reviewer:
Two things:
If applicable: