From c360e17a5edb6afa8031b165fec8453ddfc6e5c8 Mon Sep 17 00:00:00 2001 From: Chris Bandy Date: Tue, 19 Nov 2024 11:06:13 -0600 Subject: [PATCH] Add a linter to remind us about our internal package We should probably extend our discovery runner the next time we want to use the discovery client. --- .golangci.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.golangci.yaml b/.golangci.yaml index d46231c41..d886a4fb1 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -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: @@ -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]