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's CreateCRDs times out with unserved versions #1154

Closed
DirectXMan12 opened this issue Sep 8, 2020 · 2 comments · Fixed by #1189
Closed

envtest's CreateCRDs times out with unserved versions #1154

DirectXMan12 opened this issue Sep 8, 2020 · 2 comments · Fixed by #1189
Assignees
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

@DirectXMan12
Copy link
Contributor

InstallCRDs doesn't take into account that unserved versions aren't going to appear in discovery. It should do this.

/priority important-longterm
/good-first-issue
/kind bug

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

InstallCRDs doesn't take into account that unserved versions aren't going to appear in discovery. It should do this.

/priority important-longterm
/good-first-issue
/kind bug

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 priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. kind/bug Categorizes issue or PR as related to a bug. 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. labels Sep 8, 2020
yiqigao217 added a commit to yiqigao217/multi-tenancy that referenced this issue Sep 24, 2020
Set crd:trivialVersions=false to replace top-level CRD schema with
per-version schema.

Use 'kubebuilder:unservedversion` marker in v1alpha1 since it's working
after we switched to controller-gen v0.2.8 from v0.2.5.

There's no way to have metadata validation from kubebuilder marker so we
had to use kustomize. However, after switching to per-version schema,
there's no way to kustomize it per version. Thus, write script to
automatically patch the singleton validation per version.

With kubernetes-sigs/controller-runtime#1154
bug, integration test was broken with any versions unserved. Thus, write
another script to have a set of CRD manifests generated specifically for
the integration test. It still tests v1alpha2 since we still imported it.

Include the hack/ scripts in "manifests" and "test" target in Makefile.

Tested with "make test" and "make test-conversion" and manual testing on
a GKE cluster.
yiqigao217 added a commit to yiqigao217/multi-tenancy that referenced this issue Sep 24, 2020
Set crd:trivialVersions=false to replace top-level CRD schema with
per-version schema.

Use 'kubebuilder:unservedversion` marker in v1alpha1 since it's working
after we switched to controller-gen v0.2.8 from v0.2.5.

There's no way to have metadata validation from kubebuilder marker so we
had to use kustomize. However, after switching to per-version schema,
there's no way to kustomize it per version. Thus, write script to
automatically patch the singleton validation per version.

With kubernetes-sigs/controller-runtime#1154
bug, integration test was broken with any versions unserved. Thus, write
another script to have a set of CRD manifests generated specifically for
the integration test. It still tests v1alpha2 since we still imported it.

Include the hack/ scripts in "manifests" and "test" target in Makefile.

Tested with "make test" and "make test-conversion" and manual testing on
a GKE cluster.
yiqigao217 added a commit to yiqigao217/multi-tenancy that referenced this issue Sep 24, 2020
Set crd:trivialVersions=false to replace top-level CRD schema with
per-version schema.

Use 'kubebuilder:unservedversion` marker in v1alpha1 since it's working
after we switched to controller-gen v0.2.8 from v0.2.5.

There's no way to have metadata validation from kubebuilder marker so we
had to use kustomize. However, after switching to per-version schema,
there's no way to kustomize it per version. Thus, write script to
automatically patch the singleton validation per version.

With kubernetes-sigs/controller-runtime#1154
bug, integration test was broken with any versions unserved. Thus, write
another script to have a set of CRD manifests generated specifically for
the integration test. It still tests v1alpha2 since we still imported it.

Include the hack/ scripts in "manifests" and "test" target in Makefile.

Tested with "make test" and "make test-conversion" and manual testing on
a GKE cluster.
yiqigao217 added a commit to yiqigao217/multi-tenancy that referenced this issue Sep 24, 2020
Set crd:trivialVersions=false to replace top-level CRD schema with
per-version schema.

Use 'kubebuilder:unservedversion` marker in v1alpha1 since it's working
after we switched to controller-gen v0.2.8 from v0.2.5.

There's no way to have metadata validation from kubebuilder marker so we
had to use kustomize. However, after switching to per-version schema,
there's no way to kustomize it per version. Thus, write script to
automatically patch the singleton validation per version.

With kubernetes-sigs/controller-runtime#1154
bug, integration test was broken with any versions unserved. Thus, write
another script to have a set of CRD manifests generated specifically for
the integration test. It still tests v1alpha2 since we still imported it.

Include the hack/ scripts in "manifests" and "test" target in Makefile.

Tested with "make test" and "make test-conversion" and manual testing on
a GKE cluster.
yiqigao217 added a commit to yiqigao217/multi-tenancy that referenced this issue Sep 25, 2020
Set crd:trivialVersions=false to replace top-level CRD schema with
per-version schema.

Use 'kubebuilder:unservedversion` marker in v1alpha1 since it's working
after we switched to controller-gen v0.2.8 from v0.2.5.

There's no way to have metadata validation from kubebuilder marker so we
had to use kustomize. However, after switching to per-version schema,
there's no way to kustomize it per version. Thus, write script to
automatically patch the singleton validation per version.

With kubernetes-sigs/controller-runtime#1154
bug, integration test was broken with any versions unserved. Thus, write
another script to have a set of CRD manifests generated specifically for
the integration test. It still tests v1alpha2 since we still imported it.

Include the hack/ scripts in "manifests" and "test" target in Makefile.

Tested with "make test" and "make test-conversion" and manual testing on
a GKE cluster.
yiqigao217 added a commit to yiqigao217/multi-tenancy that referenced this issue Sep 25, 2020
Set crd:trivialVersions=false to replace top-level CRD schema with
per-version schema.

Use 'kubebuilder:unservedversion` marker in v1alpha1 since it's working
after we switched to controller-gen v0.2.8 from v0.2.5.

There's no way to have metadata validation from kubebuilder marker so we
had to use kustomize. However, after switching to per-version schema,
there's no way to kustomize it per version. Thus, write script to
automatically patch the singleton validation per version.

With kubernetes-sigs/controller-runtime#1154
bug, integration test was broken with any versions unserved. Thus, write
another script to have a set of CRD manifests generated specifically for
the integration test. It still tests v1alpha2 since we still imported it.

Include the hack/ scripts in "manifests" and "test" target in Makefile.

Tested with "make test" and "make test-conversion" and manual testing on
a GKE cluster.
@prafull01
Copy link
Contributor

/assign

yiqigao217 added a commit to yiqigao217/multi-tenancy that referenced this issue Apr 12, 2021
Fixes 1148.

The hack was served as a workaround for the `envtest failure with
unserved versions` bug in controller-runtime kubernetes-sigs/controller-runtime#1154

Since the bug is fixed in controller-runtime v0.7 and HNC is now using
v0.8.3, we can restore the workaround.

Tested by `make test`.
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.

4 participants