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

Envtest: support loading multiple CRDs from a single file #369

Closed
nrfox opened this issue Mar 22, 2019 · 8 comments · Fixed by #397
Closed

Envtest: support loading multiple CRDs from a single file #369

nrfox opened this issue Mar 22, 2019 · 8 comments · Fixed by #397
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.

Comments

@nrfox
Copy link

nrfox commented Mar 22, 2019

Currently envtest supports installing CRDs from yaml at specified paths however it assumes that there is only one CRD per file. Given a single file with multiple CRD documents separated by ---, envtest will read/install the first document but not the rest. This is confusing while testing because the scheme has all of the correct GVKs but tests will fail when registering the watch for the second CRD in the file with the error no matches for kind "MyKind" in version "mygroup/version". When running outside of tests, there are no errors because all the CRDs get installed properly using kubectl apply.

I'm not sure the current library used for parsing yaml supports reading multiple documents from a single file however I believe the apimachinery decoder does.

I discovered this issue because I have an external CRD as a dependency of my project which exposes its definitions as a single yaml file.

@DirectXMan12
Copy link
Contributor

/kind bug

Yeah, we should tackle this. It's not hard -- it just requires a tweak to the CRD loading code

/help-wanted

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Mar 25, 2019
@DirectXMan12 DirectXMan12 added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Mar 25, 2019
@DirectXMan12
Copy link
Contributor

/good-first-issue

@k8s-ci-robot
Copy link
Contributor

@DirectXMan12:
This request has been marked as suitable for new contributors.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-good-first-issue command.

In response to this:

/good-first-issue

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. label Mar 25, 2019
@DirectXMan12
Copy link
Contributor

/priority important-longterm

@k8s-ci-robot k8s-ci-robot added the priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. label Mar 25, 2019
@anthonyho007
Copy link
Contributor

/assign @anthonyho007

@k8s-ci-robot
Copy link
Contributor

@anthonyho007: GitHub didn't allow me to assign the following users: anthonyho007.

Note that only kubernetes-sigs members and repo collaborators can be assigned and that issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

/assign @anthonyho007

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@delp
Copy link

delp commented Mar 28, 2019

Hello,

I am a first time contributor and I wanted to try taking on this issue. I have been working with the operator-sdk, and so have some familiarity with CRDs, watches, and the controller. But I can't figure out how to build this repository, and didn't find what I was looking for in any of the docs for FAQ. Can someone help me get started?

@GrigoriyMikhalkin
Copy link
Contributor

Hi, i would like to take this issue, seems like no one is working on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants