Skip to content
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

Merged
merged 3 commits into from
Jan 17, 2020
Merged

Conversation

porridge
Copy link
Member

What this PR does / why we need it:

Otherwise we're printing empty strings. See the referenced issue.

Fixes #1279

Copy link
Contributor

@zen-dog zen-dog left a 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!

@@ -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 {
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

@kensipe kensipe left a 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!

@porridge porridge merged commit d80c8bc into master Jan 17, 2020
@porridge porridge deleted the populate-gvk branch January 17, 2020 12:17
ANeumann82 pushed a commit that referenced this pull request Feb 13, 2020
Otherwise we're printing empty strings.

Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

group/version missing in upgrade command output
4 participants