gen-crd-api-reference-docs icon indicating copy to clipboard operation
gen-crd-api-reference-docs copied to clipboard

could not get apiVersion for package k8s.io/apiextensions-apiserver/...

Open guettli opened this issue 2 years ago • 1 comments

I get this error while building my CRD docs.

F0619 10:14:33.489771 188693 main.go:140] could not get apiVersion for package k8s.io/apiextensions-apiserver/pkg/apis/apiextensions: cannot infer kubernetes apiVersion of go package k8s.io/apiextensions-apiserver/pkg/apis/apiextensions (basename "apiextensions" doesn't match expected pattern ^v\d+((alpha|beta)\d+)?$ that's used to determine apiVersion)

Does someone has an idea how to fix or work-around it?

guettli avatar Jun 19 '23 08:06 guettli

I modified the source code. I commented out the creation of the error, and added a continue.

Now I could build my docs, but it would be nice make this configurable.

	for _, pkg := range pkgs {
		apiGroup, apiVersion, err := apiVersionForPackage(pkg)
		if err != nil {
			//return nil, errors.Wrapf(err, "could not get apiVersion for package %s", pkg.Path)
			continue
		}

guettli avatar Jun 19 '23 08:06 guettli