Skip to content

Commit

Permalink
internal/pkg/scaffold/crd.go: remove controller-gen annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
joelanford committed Oct 22, 2019
1 parent 1a8d2d1 commit 9e1eda8
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions internal/pkg/scaffold/crd.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,21 @@ func (s *CRD) CustomRender() ([]byte, error) {
if err = yaml.Unmarshal(b, crd); err != nil {
return nil, err
}
// controller-tools does not set ListKind or Singular names.
setCRDNamesForResource(crd, s.Resource)

// controller-tools inserts an annotation and assumes that the binary
// that creates the CRD is controller-gen. In this case, we don't use
// controller-gen. Instead, we vendor and use the same library that
// controller-gen does.
//
// The value that gets populated in the annotation is based on the
// build info of the compiled binary, not on the version of the
// vendored controller-tools library.
//
// See: https://github.com/kubernetes-sigs/controller-tools/issues/348
//
// TODO(joelanford): Sort out what to do with this. Until then, let's
// just remove it.
delete(crd.Annotations, "controller-gen.kubebuilder.io/version")
} else {
// There are currently no commands to update CRD manifests for non-Go
// operators, so if a CRD manifest already exists for this gvk, this
Expand Down

0 comments on commit 9e1eda8

Please sign in to comment.