diff --git a/contrib/enscope/enscope.go b/contrib/enscope/enscope.go index 89f75c5fc20..5df9f8e21ad 100644 --- a/contrib/enscope/enscope.go +++ b/contrib/enscope/enscope.go @@ -132,8 +132,6 @@ func enscope(parent string, spec EnscopeSpec, in interface{}) (out interface{}, } } return o, nil - default: - return in, nil } return in, nil } diff --git a/pkg/api/meta/restmapper_test.go b/pkg/api/meta/restmapper_test.go index 09db97332e4..75d95f9085e 100644 --- a/pkg/api/meta/restmapper_test.go +++ b/pkg/api/meta/restmapper_test.go @@ -82,7 +82,7 @@ func TestRESTMapperVersionAndKindForResource(t *testing.T) { v, k, err := mapper.VersionAndKindForResource(testCase.Resource) hasErr := err != nil if hasErr != testCase.Err { - t.Errorf("%d: unexpected error behavior %f: %v", i, testCase.Err, err) + t.Errorf("%d: unexpected error behavior %t: %v", i, testCase.Err, err) continue } if v != testCase.APIVersion || k != testCase.Kind { @@ -147,7 +147,7 @@ func TestRESTMapperRESTMapping(t *testing.T) { mapping, err := mapper.RESTMapping(testCase.APIVersion, testCase.Kind) hasErr := err != nil if hasErr != testCase.Err { - t.Errorf("%d: unexpected error behavior %f: %v", i, testCase.Err, err) + t.Errorf("%d: unexpected error behavior %t: %v", i, testCase.Err, err) } if hasErr { continue diff --git a/pkg/api/v1beta1/types.go b/pkg/api/v1beta1/types.go index 68a6a8e4361..0d7a3a69fe2 100644 --- a/pkg/api/v1beta1/types.go +++ b/pkg/api/v1beta1/types.go @@ -549,7 +549,7 @@ type Status struct { // "Failure" or "Working" status. If this value is empty there // is no information available. A Reason clarifies an HTTP status // code but does not override it. - Reason StatusReason `json:"reason,omitempty" yaml:"reason,omitempty" description:"machine-readable description of why this operation is in the "Failure" or "Working" status; if this value is empty there is no information available; a reason clarifies an HTTP status code but does not override it"` + Reason StatusReason `json:"reason,omitempty" yaml:"reason,omitempty" description:"machine-readable description of why this operation is in the 'Failure' or 'Working' status; if this value is empty there is no information available; a reason clarifies an HTTP status code but does not override it"` // Extended data associated with the reason. Each reason may define its // own extended details. This field is optional and the data returned // is not guaranteed to conform to any schema except that defined by diff --git a/pkg/api/v1beta2/types.go b/pkg/api/v1beta2/types.go index 655b96aebfa..91db025fbe9 100644 --- a/pkg/api/v1beta2/types.go +++ b/pkg/api/v1beta2/types.go @@ -511,7 +511,7 @@ type Status struct { // "Failure" or "Working" status. If this value is empty there // is no information available. A Reason clarifies an HTTP status // code but does not override it. - Reason StatusReason `json:"reason,omitempty" yaml:"reason,omitempty" description:"machine-readable description of why this operation is in the "Failure" or "Working" status; if this value is empty there is no information available; a reason clarifies an HTTP status code but does not override it"` + Reason StatusReason `json:"reason,omitempty" yaml:"reason,omitempty" description:"machine-readable description of why this operation is in the 'Failure' or 'Working' status; if this value is empty there is no information available; a reason clarifies an HTTP status code but does not override it"` // Extended data associated with the reason. Each reason may define its // own extended details. This field is optional and the data returned // is not guaranteed to conform to any schema except that defined by diff --git a/pkg/apiserver/apiserver_test.go b/pkg/apiserver/apiserver_test.go index d38a9b7117b..709bddf06f1 100644 --- a/pkg/apiserver/apiserver_test.go +++ b/pkg/apiserver/apiserver_test.go @@ -278,7 +278,7 @@ func TestNotFound(t *testing.T) { } if response.StatusCode != v.Status { - t.Errorf("Expected %d for %s (%s), Got %#v", v.Status, v, k, response) + t.Errorf("Expected %d for %s (%s), Got %#v", v.Status, v.Method, k, response) } } } diff --git a/pkg/client/request_test.go b/pkg/client/request_test.go index 7c4623b5fee..210552319d4 100644 --- a/pkg/client/request_test.go +++ b/pkg/client/request_test.go @@ -143,13 +143,13 @@ func TestTransformResponse(t *testing.T) { response, created, err := r.transformResponse(test.Response, &http.Request{}) hasErr := err != nil if hasErr != test.Error { - t.Errorf("%d: unexpected error: %f %v", i, test.Error, err) + t.Errorf("%d: unexpected error: %t %v", i, test.Error, err) } if !(test.Data == nil && response == nil) && !reflect.DeepEqual(test.Data, response) { t.Errorf("%d: unexpected response: %#v %#v", i, test.Data, response) } if test.Created != created { - t.Errorf("%d: expected created %f, got %f", i, test.Created, created) + t.Errorf("%d: expected created %t, got %t", i, test.Created, created) } } } @@ -196,7 +196,7 @@ func TestRequestWatch(t *testing.T) { watch, err := testCase.Request.Watch() hasErr := err != nil if hasErr != testCase.Err { - t.Errorf("%d: expected %f, got %f: %v", i, testCase.Err, hasErr, err) + t.Errorf("%d: expected %t, got %t: %v", i, testCase.Err, hasErr, err) } if hasErr && watch != nil { t.Errorf("%d: watch should be nil when error is returned", i) @@ -231,7 +231,7 @@ func TestRequestStream(t *testing.T) { body, err := testCase.Request.Stream() hasErr := err != nil if hasErr != testCase.Err { - t.Errorf("%d: expected %f, got %f: %v", i, testCase.Err, hasErr, err) + t.Errorf("%d: expected %t, got %t: %v", i, testCase.Err, hasErr, err) } if hasErr && body != nil { t.Errorf("%d: body should be nil when error is returned", i) @@ -266,7 +266,7 @@ func TestRequestDo(t *testing.T) { body, err := testCase.Request.Do().Raw() hasErr := err != nil if hasErr != testCase.Err { - t.Errorf("%d: expected %f, got %f: %v", i, testCase.Err, hasErr, err) + t.Errorf("%d: expected %t, got %t: %v", i, testCase.Err, hasErr, err) } if hasErr && body != nil { t.Errorf("%d: body should be nil when error is returned", i) diff --git a/pkg/controller/replication_controller_test.go b/pkg/controller/replication_controller_test.go index 4a41bf93952..be39c3df139 100644 --- a/pkg/controller/replication_controller_test.go +++ b/pkg/controller/replication_controller_test.go @@ -212,7 +212,7 @@ func TestCreateReplica(t *testing.T) { manifest := api.ContainerManifest{} if err := api.Scheme.Convert(&controllerSpec.Spec.Template.Spec, &manifest); err != nil { - t.Fatalf("unexpected error", err) + t.Fatalf("unexpected error: %v", err) } expectedPod := api.Pod{ diff --git a/pkg/conversion/scheme_test.go b/pkg/conversion/scheme_test.go index 31a99f74f05..0c0ef43b728 100644 --- a/pkg/conversion/scheme_test.go +++ b/pkg/conversion/scheme_test.go @@ -169,10 +169,10 @@ func objDiff(a, b interface{}) string { // An alternate diff attempt, in case json isn't showing you // the difference. (reflect.DeepEqual makes a distinction between // nil and empty slices, for example.) - return util.StringDiff( - fmt.Sprintf("%#v", a), - fmt.Sprintf("%#v", b), - ) + //return util.StringDiff( + // fmt.Sprintf("%#v", a), + // fmt.Sprintf("%#v", b), + //) } func runTest(t *testing.T, source interface{}) { diff --git a/pkg/credentialprovider/config.go b/pkg/credentialprovider/config.go index 21d4c0b08ba..b54ff7f083f 100644 --- a/pkg/credentialprovider/config.go +++ b/pkg/credentialprovider/config.go @@ -82,7 +82,7 @@ func ReadUrl(url string, client *http.Client, header *http.Header) (body []byte, defer resp.Body.Close() if resp.StatusCode != http.StatusOK { - err := fmt.Errorf("http status code: %d while fetching url: %v", resp.StatusCode) + err := fmt.Errorf("http status code: %d while fetching url %s", resp.StatusCode, url) glog.Errorf("while trying to read %s: %v", url, err) glog.V(2).Infof("body of failing http response: %v", resp.Body) return nil, err diff --git a/pkg/kubectl/resthelper_test.go b/pkg/kubectl/resthelper_test.go index 4509211d033..1c5025eb644 100644 --- a/pkg/kubectl/resthelper_test.go +++ b/pkg/kubectl/resthelper_test.go @@ -88,7 +88,7 @@ func TestRESTHelperDelete(t *testing.T) { } err := modifier.Delete("bar", "foo") if (err != nil) != test.Err { - t.Errorf("unexpected error: %f %v", test.Err, err) + t.Errorf("unexpected error: %t %v", test.Err, err) } if err != nil { continue @@ -178,7 +178,7 @@ func TestRESTHelperCreate(t *testing.T) { } err := modifier.Create("bar", test.Modify, data) if (err != nil) != test.Err { - t.Errorf("%d: unexpected error: %f %v", i, test.Err, err) + t.Errorf("%d: unexpected error: %t %v", i, test.Err, err) } if err != nil { continue @@ -253,7 +253,7 @@ func TestRESTHelperGet(t *testing.T) { } obj, err := modifier.Get("bar", "foo", labels.Everything()) if (err != nil) != test.Err { - t.Errorf("unexpected error: %f %v", test.Err, err) + t.Errorf("unexpected error: %t %v", test.Err, err) } if err != nil { continue @@ -356,7 +356,7 @@ func TestRESTHelperUpdate(t *testing.T) { } err := modifier.Update("bar", "foo", test.Overwrite, data) if (err != nil) != test.Err { - t.Errorf("%d: unexpected error: %f %v", i, test.Err, err) + t.Errorf("%d: unexpected error: %t %v", i, test.Err, err) } if err != nil { continue diff --git a/pkg/kubelet/kubelet.go b/pkg/kubelet/kubelet.go index 6a248558562..5407476d93b 100644 --- a/pkg/kubelet/kubelet.go +++ b/pkg/kubelet/kubelet.go @@ -390,7 +390,7 @@ func fieldPath(pod *api.BoundPod, container *api.Container) (string, error) { for i := range pod.Spec.Containers { here := &pod.Spec.Containers[i] if here == container { - return fmt.Sprintf("spec.containers[%n]", i), nil + return fmt.Sprintf("spec.containers[%d]", i), nil } } return "", fmt.Errorf("container %#v not found in pod %#v", container, pod) diff --git a/pkg/labels/selector_test.go b/pkg/labels/selector_test.go index 65af12467ae..0f99517251e 100644 --- a/pkg/labels/selector_test.go +++ b/pkg/labels/selector_test.go @@ -192,10 +192,10 @@ func TestRequiresExactMatch(t *testing.T) { for k, v := range testCases { value, found := v.S.RequiresExactMatch(v.Label) if value != v.Value { - t.Errorf("%s: expected value %v, got %s", k, v.Value, value) + t.Errorf("%s: expected value %s, got %s", k, v.Value, value) } if found != v.Found { - t.Errorf("%s: expected found %v, got %s", k, v.Found, found) + t.Errorf("%s: expected found %t, got %t", k, v.Found, found) } } } diff --git a/pkg/proxy/config/etcd.go b/pkg/proxy/config/etcd.go index b03eb75753a..549f82f0774 100644 --- a/pkg/proxy/config/etcd.go +++ b/pkg/proxy/config/etcd.go @@ -230,7 +230,7 @@ func (s ConfigSourceEtcd) ProcessChange(response *etcd.Response) { } else if response.Action == "set" { service, err := etcdResponseToService(response) if err != nil { - glog.Errorf("Failed to parse %s Port: %s", response, err) + glog.Errorf("Failed to parse %#v Port: %s", response, err) return } diff --git a/pkg/registry/minion/healthy_registry.go b/pkg/registry/minion/healthy_registry.go index 92b6900864c..76054d7f9c5 100644 --- a/pkg/registry/minion/healthy_registry.go +++ b/pkg/registry/minion/healthy_registry.go @@ -81,7 +81,7 @@ func (r *HealthyRegistry) ListMinions(ctx api.Context) (currentMinions *api.Mini if status == health.Healthy { result.Items = append(result.Items, minion) } else { - glog.Errorf("%s failed a health check, ignoring.", minion) + glog.Errorf("%#v failed a health check, ignoring.", minion) } } return result, nil diff --git a/pkg/registry/minion/rest_test.go b/pkg/registry/minion/rest_test.go index 4153f7be3db..211b300ecbd 100644 --- a/pkg/registry/minion/rest_test.go +++ b/pkg/registry/minion/rest_test.go @@ -152,7 +152,7 @@ func TestMinionStorageValidUpdate(t *testing.T) { "baz": "home", } if _, err = storage.Update(ctx, minion); err != nil { - t.Error("Unexpected error: %v", err) + t.Errorf("Unexpected error: %v", err) } } diff --git a/pkg/resources/resources_test.go b/pkg/resources/resources_test.go index e7748754008..263e25a54d2 100644 --- a/pkg/resources/resources_test.go +++ b/pkg/resources/resources_test.go @@ -130,7 +130,7 @@ func TestGetFloat(t *testing.T) { for _, test := range tests { val := GetFloatResource(test.res, test.name, test.def) if val != test.expected { - t.Errorf("expected: %d found %d", test.expected, val) + t.Errorf("expected: %f found %f", test.expected, val) } } } @@ -163,7 +163,7 @@ func TestGetString(t *testing.T) { for _, test := range tests { val := GetStringResource(test.res, test.name, test.def) if val != test.expected { - t.Errorf("expected: %d found %d", test.expected, val) + t.Errorf("expected: %s found %s", test.expected, val) } } } diff --git a/pkg/runtime/helper.go b/pkg/runtime/helper.go index e7d6e3d46ed..f3f1805493f 100644 --- a/pkg/runtime/helper.go +++ b/pkg/runtime/helper.go @@ -95,7 +95,7 @@ func SetList(list Object, objects []Object) error { } else if src.Type().ConvertibleTo(dest.Type()) { dest.Set(src.Convert(dest.Type())) } else { - return fmt.Errorf("item[%v]: Type mismatch: Expected %v, got %v", dest.Type(), src.Type()) + return fmt.Errorf("item[%d]: Type mismatch: Expected %v, got %v", i, dest.Type(), src.Type()) } } items.Set(slice) diff --git a/pkg/util/iptables/iptables_test.go b/pkg/util/iptables/iptables_test.go index ed7dc26b204..83229834b13 100644 --- a/pkg/util/iptables/iptables_test.go +++ b/pkg/util/iptables/iptables_test.go @@ -399,7 +399,7 @@ func TestGetIptablesHasCheckCommand(t *testing.T) { t.Errorf("Expected error: %v, Got error: %v", testCase.Err, err) } if err == nil && testCase.Expected != check { - t.Errorf("Expected result: %v, Got result: %v") + t.Errorf("Expected result: %v, Got result: %v", testCase.Expected, check) } } } diff --git a/test/integration/utils.go b/test/integration/utils.go index a1b442067bc..056b479dd15 100644 --- a/test/integration/utils.go +++ b/test/integration/utils.go @@ -1,3 +1,5 @@ +// +build integration + /* Copyright 2014 Google Inc. All rights reserved. @@ -14,8 +16,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -// +build integration - package integration import (