providerless tag for client-go auth plugins

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
This commit is contained in:
Davanum Srinivas 2021-03-28 20:05:32 -04:00
parent bcab4c35d2
commit 1ac2d6f7fa
No known key found for this signature in database
GPG Key ID: 80D83A796103BF59
3 changed files with 36 additions and 4 deletions

View File

@ -35,3 +35,10 @@ if _out="$(go list -mod=readonly -tags "providerless" -e -json k8s.io/kubernete
echo "Verify typecheck for providerless tag failed. Found restricted packages." >&2 echo "Verify typecheck for providerless tag failed. Found restricted packages." >&2
exit 1 exit 1
fi fi
if _out="$(go list -mod=readonly -tags "providerless" -e -json k8s.io/kubernetes/cmd/kube-apiserver/... \
| grep -e Azure/azure-sdk-for-go -e github.com/aws/aws-sdk-go -e google.golang.org/api \
-e Azure/go-autorest -e oauth2/google)"; then
echo "${_out}" >&2
echo "Verify typecheck for providerless tag failed. Found restricted packages." >&2
exit 1
fi

View File

@ -1,3 +1,5 @@
// +build providerless
/* /*
Copyright 2016 The Kubernetes Authors. Copyright 2016 The Kubernetes Authors.
@ -17,9 +19,6 @@ limitations under the License.
package auth package auth
import ( import (
// Initialize all known client auth plugins. // Initialize common client auth plugins.
_ "k8s.io/client-go/plugin/pkg/client/auth/azure"
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
_ "k8s.io/client-go/plugin/pkg/client/auth/oidc" _ "k8s.io/client-go/plugin/pkg/client/auth/oidc"
_ "k8s.io/client-go/plugin/pkg/client/auth/openstack"
) )

View File

@ -0,0 +1,26 @@
// +build !providerless
/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package auth
import (
// Initialize client auth plugins for cloud providers.
_ "k8s.io/client-go/plugin/pkg/client/auth/azure"
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
_ "k8s.io/client-go/plugin/pkg/client/auth/openstack"
)