Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make sure crd-* manifests are YAML before passing to controller-gen #3996

Commits on Jul 5, 2021

  1. make sure crd-* manifests are YAML before passing to controller-gen

    The controller-gen tool's schemapatch option silently skips CRDs files that
    are not valid YAML. We often forget that, and end up merging a CRD file
    that we silently won't be able to update using ./hack/update-crds.sh.
    
    This patch uses CUE to parse the YAML files. We could have picked
    something like yq (Python) or the Go version of yq, but we don't want
    Python dependencies, and the Go version of yq has a poor UX.
    
    Here is what you can expect when one of the CRDs isn't a proper YAML
    file:
    
      % ./hack/update-crds.sh
      /home/mvalais/code/cert-manager/deploy/crds/crd-orders.yaml:14: did not find expected key
    
    Signed-off-by: Maël Valais <mael@vls.dev>
    maelvls committed Jul 5, 2021
    Configuration menu
    Copy the full SHA
    ac327d1 View commit details
    Browse the repository at this point in the history