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

🏃 Use scheme.Convert to convert unstructrured objects #779

Merged
merged 1 commit into from
Mar 2, 2020

Conversation

vincepri
Copy link
Member

@vincepri vincepri commented Jan 23, 2020

Signed-off-by: Vince Prignano vincepri@vmware.com

This PR updates the envtest helper to use a local scheme and the Convert method, which should preserve the TypeMeta information.

runtime.DefaultUnstructuredConverter doesn't know how to populate TypeMeta information from the Go Struct, while scheme.Convert uses internal helper methods to figure that out.

From a UX point of view, this change has the benefit that envtest users can use the Go structs without worrying about TypeMeta. If TypeMeta isn't present when we install CRDs, the installation will fail and envtest won't start.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 23, 2020
@vincepri
Copy link
Member Author

/assign @gerred @DirectXMan12

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jan 23, 2020
@vincepri
Copy link
Member Author

/retest

@gerred
Copy link
Contributor

gerred commented Jan 23, 2020

@vincepri my comments are generally around documentation because I agree with the organization here. Given I'm in queue to be an approver, I will save my opinion for approval and would ask @alenkacz, @shawn-hurley, @alvaroaleman, @kensipe, or @joelanford to provide the proper lgtm.

Copy link

@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.

agree with @alenkacz and @gerred otherwise looks good!

@vincepri
Copy link
Member Author

Fixed both comments, ptal

Copy link
Contributor

@alenkacz alenkacz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

thanks :)

DirectXMan12 pushed a commit that referenced this pull request Jan 31, 2020
Update kubebuilder book for typos and repaired links
@vincepri
Copy link
Member Author

vincepri commented Feb 3, 2020

@gerred ptal

pkg/envtest/helper.go Outdated Show resolved Hide resolved
pkg/envtest/helper.go Show resolved Hide resolved
@gerred
Copy link
Contributor

gerred commented Feb 5, 2020

Pending @DirectXMan12 and @vincepri updating on our API versions, I'm:

/approve

Since we have requested changes, this is not a final approve, but rather a NB 👍 in lieu of other perspectives convincing me on this change. :)

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 5, 2020
@vincepri vincepri added this to the v0.5.x milestone Feb 21, 2020
Signed-off-by: Vince Prignano <vincepri@vmware.com>
@vincepri
Copy link
Member Author

vincepri commented Mar 2, 2020

@gerred @DirectXMan12 imports have been fixed to be explicit, ptal :)

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gerred, vincepri

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

@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.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 2, 2020
@k8s-ci-robot k8s-ci-robot merged commit 37fe61b into kubernetes-sigs:master Mar 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants