Skip to content

Conversation

@cbandy
Copy link
Member

@cbandy cbandy commented Aug 19, 2025

Checklist:

  • Have you added an explanation of what your changes do and why you'd like them to be included?
  • Have you updated or added documentation for the change, as applicable?
  • Have you tested your changes on all related environments with successful results, as applicable?
    • Have you added automated tests?

Type of Changes:

  • Testing enhancement

What is the current behavior (link to any open issues here)?

Cryptic panics (!!) stating Rel: can't make relative to /projects/postgres-operator

Without an explicit -mod flag, golang.org/x/tools/go/packages returns package information from the vendor directory, when it exists. The vendor directory does not contain Kubernetes YAML files.

What is the new behavior (if this is a feature change)?

Tests work when a vendor directory is present.

The -mod=readonly build flag returns information about packages in the module cache. These directories do contain Kubernetes YAML files.

Other Information:

The make clean target deletes any vendor directory.

Without an explicit "-mod" flag, "golang.org/x/tools/go/packages"
returns package information from the "vendor" directory, when it exists.
The "vendor" directory only contains what Go needs to compile packages
for the main module. It does *not* contain Kubernetes YAML files.

The "-mod=readonly" build flag returns information about packages in the
module cache. These directories *do* contain Kubernetes YAML files.

Co-authored-by: Benjamin Blattberg <ben.blattberg@crunchydata.com>
See: https://go.dev/ref/mod#build-commands
@cbandy cbandy requested a review from benjaminjb August 19, 2025 21:40
Copy link
Contributor

@benjaminjb benjaminjb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, works locally

@cbandy cbandy merged commit ff9494c into CrunchyData:main Aug 20, 2025
17 checks passed
@cbandy cbandy deleted the vendor-modules branch August 20, 2025 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants