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

Support additional unversioned types

Open abayer opened this issue 3 years ago • 1 comments

github.com/tektoncd/pipeline has an additional type in https://github.com/tektoncd/pipeline/tree/main/pkg/apis/pipeline/pod which isn't versioned, and shouldn't be its own package section in the generated doc, but is referenced in versioned packages under pkg/apis/pipeline. This probably isn't the ideal way to have things set up, but it's what we've got. In order to use this tool to generate reference docs for Tekton Pipeline properly, we need to include the type in that package.

To enable that, this adds an additional doc comment, +gencrdrefdocs:unversionedTypes. When that is found in a package's doc.go and that package isn't already being included normally, its types will be made available for reference by the "real" API packages, with unversioned as their version.

I also fixed the existing docCommentForceIncludes - pkg.DocComments doesn't include the // prefix, so searching for // +gencrdrefdocs:force would always fail. Therefore, I removed the // prefix.

Signed-off-by: Andrew Bayer [email protected]

abayer avatar Jan 18 '22 17:01 abayer

Hi @ahmetb - just wondering if you've had a chance to look at this. Thanks!

abayer avatar Mar 24 '22 14:03 abayer