Skip to content

Commit

Permalink
Merge pull request #13637 from soltysh/fix_govet
Browse files Browse the repository at this point in the history
Merged by openshift-bot
  • Loading branch information
OpenShift Bot authored Apr 5, 2017
2 parents eed9d95 + 275c934 commit fdd7cc1
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 31 deletions.
12 changes: 7 additions & 5 deletions hack/verify-govet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ govet_blacklist=(
"pkg/auth/ldaputil/client.go:[0-9]+: assignment copies lock value to c: crypto/tls.Config contains sync.Once contains sync.Mutex"
"pkg/.*/client/clientset_generated/internalclientset/fake/clientset_generated.go:[0-9]+: literal copies lock value from fakePtr: github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/testing/core.Fake"
"pkg/.*/client/clientset_generated/release_v1_./fake/clientset_generated.go:[0-9]+: literal copies lock value from fakePtr: github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/testing/core.Fake"
"pkg/.*/clientset/internalclientset/fake/clientset_generated.go:[0-9]+: literal copies lock value from fakePtr: github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/testing/core.Fake"
"pkg/.*/clientset/release_v3_./fake/clientset_generated.go:[0-9]+: literal copies lock value from fakePtr: github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/testing/core.Fake"
)

function govet_blacklist_contains() {
Expand Down Expand Up @@ -68,11 +70,11 @@ for test_dir in $ALL_DIRS
do
# use `grep` failure to determine that a directory is not in the blacklist
if ! echo "${DIR_BLACKLIST}" | grep -q "${test_dir}"; then
go tool vet -shadow -shadowstrict $test_dir
if [ "$?" -ne "0" ]
then
FAILURE=true
fi
go tool vet -shadow -shadowstrict $test_dir
if [ "$?" -ne "0" ]
then
FAILURE=true
fi
fi
done

Expand Down
50 changes: 25 additions & 25 deletions pkg/util/restoptions/configgetter.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,31 +106,31 @@ func (g *configRESTOptionsGetter) loadSettings() error {

// use legacy group name "" for all resources that existed when apigroups were introduced
for _, gvr := range []unversioned.GroupVersionResource{
{"authorization.openshift.io", "v1", "clusterpolicybindings"},
{"authorization.openshift.io", "v1", "clusterpolicies"},
{"authorization.openshift.io", "v1", "policybindings"},
{"authorization.openshift.io", "v1", "rolebindingrestrictions"},
{"authorization.openshift.io", "v1", "policies"},
{"build.openshift.io", "v1", "builds"},
{"build.openshift.io", "v1", "buildconfigs"},
{"apps.openshift.io", "v1", "deploymentconfigs"},
{"image.openshift.io", "v1", "imagestreams"},
{"image.openshift.io", "v1", "images"},
{"oauth.openshift.io", "v1", "oauthclientauthorizations"},
{"oauth.openshift.io", "v1", "oauthaccesstokens"},
{"oauth.openshift.io", "v1", "oauthauthorizetokens"},
{"oauth.openshift.io", "v1", "oauthclients"},
{"project.openshift.io", "v1", "projects"},
{"quota.openshift.io", "v1", "clusterresourcequotas"},
{"route.openshift.io", "v1", "routes"},
{"network.openshift.io", "v1", "netnamespaces"},
{"network.openshift.io", "v1", "hostsubnets"},
{"network.openshift.io", "v1", "clusternetworks"},
{"network.openshift.io", "v1", "egressnetworkpolicies"},
{"template.openshift.io", "v1", "templates"},
{"user.openshift.io", "v1", "groups"},
{"user.openshift.io", "v1", "users"},
{"user.openshift.io", "v1", "identities"},
{Group: "authorization.openshift.io", Version: "v1", Resource: "clusterpolicybindings"},
{Group: "authorization.openshift.io", Version: "v1", Resource: "clusterpolicies"},
{Group: "authorization.openshift.io", Version: "v1", Resource: "policybindings"},
{Group: "authorization.openshift.io", Version: "v1", Resource: "rolebindingrestrictions"},
{Group: "authorization.openshift.io", Version: "v1", Resource: "policies"},
{Group: "build.openshift.io", Version: "v1", Resource: "builds"},
{Group: "build.openshift.io", Version: "v1", Resource: "buildconfigs"},
{Group: "apps.openshift.io", Version: "v1", Resource: "deploymentconfigs"},
{Group: "image.openshift.io", Version: "v1", Resource: "imagestreams"},
{Group: "image.openshift.io", Version: "v1", Resource: "images"},
{Group: "oauth.openshift.io", Version: "v1", Resource: "oauthclientauthorizations"},
{Group: "oauth.openshift.io", Version: "v1", Resource: "oauthaccesstokens"},
{Group: "oauth.openshift.io", Version: "v1", Resource: "oauthauthorizetokens"},
{Group: "oauth.openshift.io", Version: "v1", Resource: "oauthclients"},
{Group: "project.openshift.io", Version: "v1", Resource: "projects"},
{Group: "quota.openshift.io", Version: "v1", Resource: "clusterresourcequotas"},
{Group: "route.openshift.io", Version: "v1", Resource: "routes"},
{Group: "network.openshift.io", Version: "v1", Resource: "netnamespaces"},
{Group: "network.openshift.io", Version: "v1", Resource: "hostsubnets"},
{Group: "network.openshift.io", Version: "v1", Resource: "clusternetworks"},
{Group: "network.openshift.io", Version: "v1", Resource: "egressnetworkpolicies"},
{Group: "template.openshift.io", Version: "v1", Resource: "templates"},
{Group: "user.openshift.io", Version: "v1", Resource: "groups"},
{Group: "user.openshift.io", Version: "v1", Resource: "users"},
{Group: "user.openshift.io", Version: "v1", Resource: "identities"},
} {
resourceEncodingConfig.SetResourceEncoding(gvr.GroupResource(), unversioned.GroupVersion{Version: gvr.Version}, unversioned.GroupVersion{Version: runtime.APIVersionInternal})
}
Expand Down
2 changes: 1 addition & 1 deletion test/integration/master_routes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ func TestApiGroups(t *testing.T) {
}
respBuild, ok := respObj.(*buildv1.Build)
if !ok {
t.Fatalf("Unexpected type %t, expected buildv1.Build", respObj)
t.Fatalf("Unexpected type %T, expected buildv1.Build", respObj)
}
if got, expected := respBuild.APIVersion, buildv1.SchemeGroupVersion.String(); got != expected {
t.Fatalf("Unexpected APIVersion: got=%q, expected=%q", got, expected)
Expand Down

0 comments on commit fdd7cc1

Please sign in to comment.