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

✨ Expose CRDInstallOptions via envtest.Environment #544

Merged

Conversation

rajathagasthya
Copy link
Contributor

This change provides better control for installing CRDs in envtest.

Fixes #541

@k8s-ci-robot k8s-ci-robot added do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jul 28, 2019
@k8s-ci-robot k8s-ci-robot requested review from droot and pwittrock July 28, 2019 06:27
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 28, 2019
@rajathagasthya rajathagasthya force-pushed the envtest-crdopts-541 branch 2 times, most recently from f18db79 to f339933 Compare July 28, 2019 06:30
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Jul 28, 2019
@rajathagasthya
Copy link
Contributor Author

/assign @DirectXMan12

// If both this field and Paths field in CRDInstallOptions are specified, this
// value this ignored.
//
// Deprecated: Use CRDInstallOptions
Copy link
Contributor

Choose a reason for hiding this comment

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

let's not deprecate these -- they're way more convenient when constructing the object directly -- constructing embedded objects is a pain.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds reasonable.

te.CRDInstallOptions.CRDs = te.CRDs
}
if len(te.CRDInstallOptions.Paths) == 0 {
te.CRDInstallOptions.Paths = te.CRDDirectoryPaths
Copy link
Contributor

Choose a reason for hiding this comment

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

can't we just append here?

Copy link
Contributor Author

@rajathagasthya rajathagasthya Aug 1, 2019

Choose a reason for hiding this comment

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

Sure, will do. Do we need to filter out "duplicate" paths and CRDs though? In case the same values are passed both directly and via CRDInstallOptions?

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, probably.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just to clarify, "duplicate" CRDs mean they contain the same name right? I don't have to DeepEqual or anything on those CRD objects?

Copy link
Contributor

Choose a reason for hiding this comment

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

identical name is sufficient. Duplicate name with different contents is an error, so we don't need to try and support that.

This change provides better control for installing CRDs in `envtest`.

Addresses kubernetes-sigs#541
@DirectXMan12
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Sep 17, 2019
@DirectXMan12
Copy link
Contributor

let's see if we can re-trigger the tests

/retest

@DirectXMan12
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 17, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: DirectXMan12, rajathagasthya

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 17, 2019
@k8s-ci-robot k8s-ci-robot merged commit 0fa2e7c into kubernetes-sigs:master Sep 17, 2019
@rajathagasthya rajathagasthya deleted the envtest-crdopts-541 branch September 17, 2019 22:28
DirectXMan12 pushed a commit that referenced this pull request Jan 31, 2020
Update book README, fix a typo and formatting
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

envtest: expose CRDInstallOptions via Environment
3 participants