Repository navigation
Restores display of object status when displaying helm status - #7785
Merged
Merged
Conversation
Member
|
Taking this for a spin and trying to sift through the Kubernetes codebase to see if there's a better way. |
bacongobbler
approved these changes
Mar 19, 2020
Changes to the Kubernetes API server and kubectl libraries caused the status to no longer display when helm status was run for a release. This change restores the status display. Generation of the tables for display was moved server side. A request for the data as a table is made and a kubectl printer for tables can display this data. Kubectl uses this setup and the structure here closely resembles kubectl. kubectl is still able to display objects as tables from prior to server side printing but only prints limited information. Note, an extra request is made because table responses cannot be easily transformed into Go objects for Kubernetes types to work with. There is one request to get the resources for display in a table and a second request to get the resources to lookup the related pods. The related pods are now requested as a table as well for display purposes. This is likely part of the larger trend to move features like this server side so that more libraries in more languages can get to the feature. Closes helm#6896 Signed-off-by: Matt Farina <[email protected]>
Collaborator
Author
|
Note, the latest change also fixes sorting and versions of Kubernetes 1.14 and older. |
thomastaylor312
approved these changes
Mar 20, 2020
bacongobbler
approved these changes
Mar 20, 2020
| func transformRequests(req *rest.Request) { | ||
|
|
||
| // The request headers are for both the v1 and v1beta1 versions of the table | ||
| // as Kubernetes 1.14 and older used the beta version. |
Collaborator
Author
|
Thanks for the reviews. This was a hairy problem. |
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.
Changes to the Kubernetes API server and kubectl libraries caused
the status to no longer display when helm status was run for a
release. This change restores the status display.
Generation of the tables for display was optionally moved server
side. A request for the data as a table is made and a kubectl
printer for tables can display this data. Kubectl uses this setup and
the structure here closely resembles kubectl. kubectl is still
able to display objects as tables from prior to server side
printing. Server side printing is able to handle non-core
resources like CRDs.
Note, an extra request is made because table responses cannot be
easily transformed into Go objects for Kubernetes types to work
with. There is one request to get the resources for display in
a table and a second request to get the resources to lookup the
related pods. The related pods are now requested as a table as
well for display purposes.
This is likely part of the larger trend to move features like
this server side so that more libraries in more languages can
get to the feature.
The fix only works for Kubernetes 1.15 and newer. This is when
the table functionality was added to the api server. Kubernetes
supports the latest 3 minor versions meaning kubectl does the
same. It only needs to support back to 1.15 now for table
display. In Kubernetes 1.14 kubectl can still display the table
information using different printing methods.
Closes #6896
If someone knows how to fix this without using server side printing I would appreciate knowing as it would enable support to 1.14 and older versions of Kubernetes.