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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 crdgen: compare metav1 pkg by ID #681

Merged
merged 2 commits into from May 31, 2022

Commits on May 30, 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 committed May 30, 2022
    Copy the full SHA
    5a4abd5 View commit details
    Browse the repository at this point in the history

Commits on May 31, 2022

  1. 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 committed May 31, 2022
    Copy the full SHA
    fd1c4b4 View commit details
    Browse the repository at this point in the history