Skip to content

Unable to use apiextensions.k8s.io/v1 as CRD version for envtest #1034

@billcchung

Description

@billcchung

Hi I'm hitting an issue when trying to update our CRD version to apiextensions.k8s.io/v1

I'm using controller-gen 0.3.0, and added crd:crdVersions=v1 as CRD generation option, it successfully generated as

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    controller-gen.kubebuilder.io/version: v0.3.0

however envtest seems only initialized v1beta1, I kept getting the following error from suite_test.go:

  Unexpected error:
      <*meta.NoKindMatchError | 0xc00072db40>: {
          GroupKind: {
              Group: "apiextensions.k8s.io",
              Kind: "CustomResourceDefinition",
          },
          SearchedVersions: ["v1"],
      }
      no matches for kind "CustomResourceDefinition" in version "apiextensions.k8s.io/v1"
  occurred

pkg versions:

	k8s.io/api v0.18.5
	k8s.io/apimachinery v0.18.5
	k8s.io/client-go v0.18.5
	sigs.k8s.io/controller-runtime v0.6.0

I see envtest has https://github.com/kubernetes-sigs/controller-runtime/blob/release-0.6/pkg/envtest/helper.go#L16,
but k8s.io/api doesnt have v1 yet: https://pkg.go.dev/k8s.io/api@v0.18.5, is it because of this? is so is there plan to add or any workaround?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/awaiting-more-evidenceLowest priority. Possibly useful, but not yet enough support to actually get it done.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions