ob/rules_kubebuilder

Controller-gen binary has bad version

mogensen opened this issue · 3 comments

First of, great tool!

The only issue I have encountered is that the version of controller-gen included in the bazel rules does not have the correct version set.

See:
image

This results in the following annotation on the generated CRDs:

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    controller-gen.kubebuilder.io/version: (devel)

Because of this we can't tell which version is used to generate the different CRDs.

ob commented

Ah, good catch. I was really hoping that at some point controller-tools would put out binary releases, I keep waiting for #500 to be resolved :-)

At any rate, in the meantime I'll see if I can figure out how to fix it. Thanks!

Hi @ob, I'm interested in this one too. I was thinking of trying to push a fix, if you have any pointers, thank you.

ob commented

@kriscfoster I think the problem is how controller-gen is being built. If you just clone it and build it you get this (devel) version. Whoh is what the build script is doing. I think the right fix is to actually solve kubernetes-sigs/controller-tools#500 and then just consume the binaries directly via and http_archive() rule.