Skip to content

Commit

Permalink
Add a linter to remind us about our internal package
Browse files Browse the repository at this point in the history
We should probably extend our discovery runner the next time we want to
use the discovery client.
  • Loading branch information
cbandy committed Nov 25, 2024
1 parent b4d7444 commit c360e17
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ linters-settings:
- pkg: github.com/crunchydata/postgres-operator/internal/testing/*
desc: The "internal/testing" packages should be used only in tests.

- pkg: k8s.io/client-go/discovery
desc: Use the "internal/kubernetes" package instead.

tests:
files: ['$test']
deny:
Expand Down Expand Up @@ -93,6 +96,11 @@ linters-settings:
issues:
exclude-generated: strict
exclude-rules:
# This internal package is the one place we want to do API discovery.
- linters: [depguard]
path: internal/kubernetes/discovery.go
text: k8s.io/client-go/discovery

# These value types have unmarshal methods.
# https://github.com/raeperd/recvcheck/issues/7
- linters: [recvcheck]
Expand Down

0 comments on commit c360e17

Please sign in to comment.