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

Refactor: Tidy some imports and tests #4032

Merged
merged 4 commits into from
Nov 18, 2024
Merged

Conversation

cbandy
Copy link
Member

@cbandy cbandy commented Nov 15, 2024

This adds two functions to internal/controller/runtime to reduce the imports in the pgBackRest controller and adds a linter to keep github.com/pkg/errors out of tests.

This also uses golang.org/x/tools/go/packages to load VolumeSnapshot CRDs from the (already downloaded) client Go module.

@cbandy cbandy force-pushed the tidy-imports branch 2 times, most recently from 669c00c to bfc5907 Compare November 15, 2024 16:45
The default unstructured converter does not complain if you try to
convert a list to an object or vice versa. It also expects to be called
with an empty target object.
Tests already report the line on which an assert fails, and the
standard "errors" packages unwraps errors.
We only use these CRD files in Go tests, and Go has already downloaded
them as part of the module we import for serializing API objects.
@cbandy cbandy merged commit ec99117 into CrunchyData:main Nov 18, 2024
15 of 16 checks passed
@cbandy cbandy deleted the tidy-imports branch November 18, 2024 20:12
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.

3 participants