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

🐛 crdgen: compare metav1 pkg by ID #686

Commits on May 31, 2022

  1. crdgen: compare metav1 pkg by ID & fsp loader

    This patch updates the way the CRD generator compares an imported
    metav1 package. Previously the comparison occurred using a Golang
    equality operator, !=, against two, in-memory data structures.
    However, this fails when multiple root paths are loaded. Their
    metav1 packages are identical, just not identical objects in
    memory. This patch updates the comparison to compare the package
    IDs, not the instance of the object.
    
    This patch also introduces a filesystem-path specific loader for
    each unique filesystem path provided as a root. This ensures the
    AST is loaded correctly and the kubebuilder markers are parsed as
    intended.
    akutz authored and k8s-infra-cherrypick-robot committed May 31, 2022
    Copy the full SHA
    cd454df View commit details
    Browse the repository at this point in the history
  2. Reproduce the issue

    This patch adds tests to reproduce the issue of the markers
    not being discovered when multiple paths are used.
    
    The issue is not markers missing from a type, but markers missing
    from a *referenced* type. For example, the new Job type imports
    the unserved.CronJobSpec as the field Job.Spec.CronJob. The
    markers are not generated for Job.Spec.CronJob as it is referenced
    from another package.
    akutz authored and k8s-infra-cherrypick-robot committed May 31, 2022
    Copy the full SHA
    75004e8 View commit details
    Browse the repository at this point in the history