Teach Gazelle about k8s import paths in @kubernetes
This prevents "gazelle update" from attempting to add its
go_repository equivalent to the auto-generated BUILD file.
We still need to keep the entries in Go.mod and Gazelle
will generate unused go_repository rules for them, because
`go mod tidy` would break otherwise (and we cannot use a
replace directive or a symlink, because replacing requires
a Go.mod file, which the Kubernetes repo does not have,
and symlinks are not a thing for external dependencies).
This was broken in master since D271.
Test Plan:
Ran `scripts/gazelle.sh`, `bazel build :gopath`,
and then the script again. This previously broke and now works.
X-Origin-Diff: phab/D310
GitOrigin-RevId: 79c1b2836e86df6baddbc1a1dd770e6c0dd84133
diff --git a/BUILD b/BUILD
index ba234e7..9431197 100644
--- a/BUILD
+++ b/BUILD
@@ -5,6 +5,8 @@
# gazelle:exclude core/generated
# gazelle:exclude tools.go
# gazelle:exclude core/cmd/kube-controlplane
+# gazelle:resolve go k8s.io/client-go/tools/clientcmd @kubernetes//staging/src/k8s.io/client-go/tools/clientcmd:go_default_library
+# gazelle:resolve go k8s.io/client-go/tools/clientcmd/api @kubernetes//staging/src/k8s.io/client-go/tools/clientcmd/api:go_default_library
gazelle(name = "gazelle")
# Shortcut for the Go SDK