-
Notifications
You must be signed in to change notification settings - Fork 104
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
Populate GVK in objects fetched from API server. #1280
Conversation
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 the second time we have issues because client clears the GVK "by design" 🤦♂ Thx!
pkg/kudoctl/util/kudo/kudo.go
Outdated
@@ -127,13 +129,30 @@ func (c *Client) InstanceExistsInCluster(operatorName, namespace, version, insta | |||
return true, nil | |||
} | |||
|
|||
// Populate the GVK from scheme, since it is cleared by design on typed objects. | |||
// https://github.com/kubernetes/client-go/issues/413 | |||
func setFirstGVK(object runtime.Object) 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.
mentally parsing the func name "FirstGVK"... I don't understand... is this initializing?
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.
We're setting GVK. The value we use is the first of the available values in Scheme.ObjectKinds
.
Suggestions for a better name most welcome.
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.
looks great! nice work!
Otherwise we're printing empty strings. Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>
What this PR does / why we need it:
Otherwise we're printing empty strings. See the referenced issue.
Fixes #1279