Skip to content

Commit eee71bb

Browse files
committed
fix the go 1.10 unit test failures
1 parent 83ac5ae commit eee71bb

File tree

10 files changed

+17
-18
lines changed

10 files changed

+17
-18
lines changed

pkg/cmd/server/apis/config/v1/types.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ type UserAgentMatchRule struct {
506506

507507
// UserAgentDenyRule adds a rejection message that can be used to help a user figure out how to get an approved client
508508
type UserAgentDenyRule struct {
509-
UserAgentMatchRule `json:", inline"`
509+
UserAgentMatchRule `json:",inline"`
510510

511511
// RejectionMessage is the message shown when rejecting a client. If it is not a set, the default message is used.
512512
RejectionMessage string `json:"rejectionMessage"`

pkg/cmd/server/start/start_node.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ func execKubelet(kubeletArgs []string) error {
419419
for i, s := range os.Args {
420420
if s == "--vmodule" {
421421
if i+1 < len(os.Args) {
422-
args = append(args, fmt.Sprintf("--vmodule=", os.Args[i+1]))
422+
args = append(args, fmt.Sprintf("--vmodule=%q", os.Args[i+1]))
423423
break
424424
}
425425
}

pkg/oauthserver/osinserver/osinserver_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ func TestAuthorizeStartFlow(t *testing.T) {
127127
}
128128
url := config.AuthCodeURL("")
129129
client := http.Client{ /*CheckRedirect: func(req *http.Request, via []*http.Request) error {
130-
t.Logf("redirect (%d): to %s, %#v", len(via), req.URL, req)
131-
return nil
132-
}*/}
130+
t.Logf("redirect (%d): to %s, %#v", len(via), req.URL, req)
131+
return nil
132+
}*/}
133133
if _, err := client.Get(url); err != nil {
134134
t.Fatalf("unexpected error: %v", err)
135135
}

pkg/oc/cli/describe/describer.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1873,7 +1873,7 @@ func describeSecurityContextConstraints(scc *securityapi.SecurityContextConstrai
18731873

18741874
fmt.Fprintf(out, "Settings:\t\n")
18751875
fmt.Fprintf(out, " Allow Privileged:\t%t\n", scc.AllowPrivilegedContainer)
1876-
fmt.Fprintf(out, " Allow Privilege Escalation:\t%t\n", scc.AllowPrivilegeEscalation)
1876+
fmt.Fprintf(out, " Allow Privilege Escalation:\t%v\n", scc.AllowPrivilegeEscalation)
18771877
fmt.Fprintf(out, " Default Add Capabilities:\t%s\n", capsToString(scc.DefaultAddCapabilities))
18781878
fmt.Fprintf(out, " Required Drop Capabilities:\t%s\n", capsToString(scc.RequiredDropCapabilities))
18791879
fmt.Fprintf(out, " Allowed Capabilities:\t%s\n", capsToString(scc.AllowedCapabilities))

pkg/security/securitycontextconstraints/provider_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ func defaultPod() *api.Pod {
836836
ObjectMeta: metav1.ObjectMeta{Annotations: map[string]string{}},
837837
Spec: api.PodSpec{
838838
SecurityContext: &api.PodSecurityContext{
839-
// fill in for test cases
839+
// fill in for test cases
840840
},
841841
Containers: []api.Container{
842842
{

test/integration/dockerregistryclient_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func TestRegistryClientConnectPulpRegistry(t *testing.T) {
123123
}, imageNotFoundErrorPatterns...)
124124
if err != nil {
125125
if strings.Contains(err.Error(), "x509: certificate has expired or is not yet valid") {
126-
t.Skip("SKIPPING: due to expired certificate of %s: %v", pulpRegistryName, err)
126+
t.Skipf("SKIPPING: due to expired certificate of %s: %v", pulpRegistryName, err)
127127
}
128128
t.Skip("pulp is failing")
129129
//t.Fatal(err)
@@ -257,6 +257,6 @@ func TestRegistryClientQuayIOImage(t *testing.T) {
257257
return err
258258
}, imageNotFoundErrorPatterns...)
259259
if err != nil {
260-
t.Skip("SKIPPING: unexpected error from quay.io: %v", err)
260+
t.Skipf("SKIPPING: unexpected error from quay.io: %v", err)
261261
}
262262
}

test/integration/imageimporter_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ func TestImageStreamImportRedHatRegistry(t *testing.T) {
10011001
}, imageNotFoundErrorPatterns...)
10021002
if err != nil {
10031003
if strings.Contains(err.Error(), "x509: certificate has expired or is not yet valid") {
1004-
t.Skip("SKIPPING: due to expired certificate of %s: %v", pulpRegistryName, err)
1004+
t.Skipf("SKIPPING: due to expired certificate of %s: %v", pulpRegistryName, err)
10051005
}
10061006
t.Fatal(err.Error())
10071007
}

test/integration/oauth_cert_fallback_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ func TestOAuthCertFallback(t *testing.T) {
2525
noToken = ""
2626

2727
invalidCert = restclient.TLSClientConfig{
28-
// We have to generate this dynamically in order to have an invalid cert signed by a signer with the same name as the valid CA
29-
// CertData: ...,
30-
// KeyData: ...,
28+
// We have to generate this dynamically in order to have an invalid cert signed by a signer with the same name as the valid CA
29+
// CertData: ...,
30+
// KeyData: ...,
3131
}
3232
noCert = restclient.TLSClientConfig{}
3333

test/integration/oauthstorage_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,9 @@ func TestOAuthStorage(t *testing.T) {
152152
}
153153
url := config.AuthCodeURL("")
154154
client := http.Client{ /*CheckRedirect: func(req *http.Request, via []*http.Request) error {
155-
t.Logf("redirect (%d): to %s, %#v", len(via), req.URL, req)
156-
return nil
157-
}*/}
155+
t.Logf("redirect (%d): to %s, %#v", len(via), req.URL, req)
156+
return nil
157+
}*/}
158158

159159
resp, err := client.Get(url)
160160
if err != nil {

tools/rebasehelpers/godepchecker/godepchecker.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ func main() {
2525
Assumes the following:
2626
- $GOPATH is set to a single directory (not the godepsified path)
2727
- "godeps save ./..." has not yet been run on origin
28-
- The desired level of kubernetes is checked out
29-
`)
28+
- The desired level of kubernetes is checked out`)
3029
var self, other string
3130
var checkoutNewer, examineForks bool
3231
flag.StringVar(&self, "self", filepath.Join(gopath, "src/github.com/openshift/origin/Godeps/Godeps.json"), "The first file to compare")

0 commit comments

Comments
 (0)