Merge pull request #42466 from sttts/sttts-client-go-plugin-import-verify

Automatic merge from submit-queue

hack/verify-staging-imports.sh: check that plugins are not imported b…
This commit is contained in:
Kubernetes Submit Queue 2017-04-12 03:02:35 -07:00 committed by GitHub
commit d70b55ead5
4 changed files with 12 additions and 4 deletions

View File

@ -77,4 +77,12 @@ if grep -rq '// import "k8s.io/kubernetes/' 'staging/'; then
exit 1
fi
for EXAMPLE in vendor/k8s.io/client-go/examples/{in-cluster,out-of-cluster,third-party-resources}; do
test -d "${EXAMPLE}" # make sure example is still there
if go list -f '{{ join .Deps "\n" }}' "./${EXAMPLE}/..." | sort | uniq | grep -q k8s.io/client-go/plugin; then
echo "${EXAMPLE} imports client-go plugins by default, but shouldn't."
exit 1
fi
done
exit 0

View File

@ -25,6 +25,8 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/clientcmd"
// Uncomment the following line to load the gcp plugin (only required to authenticate against GKE clusters).
// _ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
)
func main() {

View File

@ -31,9 +31,8 @@ import (
"k8s.io/client-go/pkg/apis/extensions/v1beta1"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
// Only required to authenticate against GKE clusters
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
// Uncomment the following line to load the gcp plugin (only required to authenticate against GKE clusters).
// _ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
)
func main() {

1
vendor/BUILD vendored
View File

@ -12194,7 +12194,6 @@ go_library(
"//vendor:k8s.io/client-go/kubernetes",
"//vendor:k8s.io/client-go/pkg/api",
"//vendor:k8s.io/client-go/pkg/apis/extensions/v1beta1",
"//vendor:k8s.io/client-go/plugin/pkg/client/auth/gcp",
"//vendor:k8s.io/client-go/rest",
"//vendor:k8s.io/client-go/tools/clientcmd",
],