Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix some syntax related errors #59725

Merged
merged 1 commit into from
Feb 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ values:
Param("watch", "true").
DoRaw()
if !errors.IsNotAcceptable(err) {
t.Fatal("expected not acceptable error, got %v (%s)", err, string(result))
t.Fatalf("expected not acceptable error, got %v (%s)", err, string(result))
}
obj, err := decodeYAML(result)
if err != nil {
Expand Down Expand Up @@ -294,15 +294,15 @@ values:
t.Fatal(v, ok, err, string(result))
}
if obj.GetUID() != uid {
t.Fatal("uid changed: %v vs %v", uid, obj.GetUID())
t.Fatalf("uid changed: %v vs %v", uid, obj.GetUID())
}
}

// Patch rejects yaml requests (only JSON mime types are allowed)
{
yamlBody := []byte(fmt.Sprintf(`
values:
numVal: 3`, apiVersion, kind, uid, resourceVersion))
numVal: 3`))
result, err := rest.Patch(types.MergePatchType).
SetHeader("Accept", "application/yaml").
SetHeader("Content-Type", "application/yaml").
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ func TestFailGettingIPv4Routes(t *testing.T) {
errStrFrag := "no such file"
_, err := v4File.extract()
if err == nil {
fmt.Errorf("Expected error trying to read non-existent v4 route file")
t.Errorf("Expected error trying to read non-existent v4 route file")
}
if !strings.Contains(err.Error(), errStrFrag) {
t.Errorf("Unable to find %q in error string %q", errStrFrag, err.Error())
Expand All @@ -638,7 +638,7 @@ func TestFailGettingIPv6Routes(t *testing.T) {
errStrFrag := "no such file"
_, err := v6File.extract()
if err == nil {
fmt.Errorf("Expected error trying to read non-existent v6 route file")
t.Errorf("Expected error trying to read non-existent v6 route file")
}
if !strings.Contains(err.Error(), errStrFrag) {
t.Errorf("Unable to find %q in error string %q", errStrFrag, err.Error())
Expand All @@ -653,7 +653,7 @@ func TestGetAllDefaultRoutesFailNoV4RouteFile(t *testing.T) {
errStrFrag := "no such file"
_, err := getAllDefaultRoutes()
if err == nil {
fmt.Errorf("Expected error trying to read non-existent v4 route file")
t.Errorf("Expected error trying to read non-existent v4 route file")
}
if !strings.Contains(err.Error(), errStrFrag) {
t.Errorf("Unable to find %q in error string %q", errStrFrag, err.Error())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ func testCache(cache cache, t *testing.T) {
// when empty, record is stored
cache.set("foo", record1, time.Hour)
if result, ok := cache.get("foo"); !ok || result != record1 {
t.Errorf("Expected %#v, true, got %#v, %v", record1, ok)
t.Errorf("Expected %#v, true, got %#v, %v", record1, result, ok)
}

// newer record overrides
cache.set("foo", record2, time.Hour)
if result, ok := cache.get("foo"); !ok || result != record2 {
t.Errorf("Expected %#v, true, got %#v, %v", record2, ok)
t.Errorf("Expected %#v, true, got %#v, %v", record2, result, ok)
}

// removing the current value removes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ func TestAuditIDHttpHeader(t *testing.T) {
}
} else {
if resp.Header.Get("Audit-ID") != "" {
t.Errorf("[%s] expected no Audit-ID http header returned, but got %p", test.desc, resp.Header.Get("Audit-ID"))
t.Errorf("[%s] expected no Audit-ID http header returned, but got %s", test.desc, resp.Header.Get("Audit-ID"))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// Package envelope transforms values for storage at rest using a Envelope provider

// +build !windows

// Package envelope transforms values for storage at rest using a Envelope provider
package envelope

import (
Expand Down
2 changes: 1 addition & 1 deletion staging/src/k8s.io/client-go/scale/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func fakeScaleClient(t *testing.T) (ScalesGetter, []schema.GroupResource) {

restMapperRes, err := discovery.GetAPIGroupResources(fakeDiscoveryClient)
if err != nil {
t.Fatalf("unexpected error while constructing resource list from fake discovery client: %v")
t.Fatalf("unexpected error while constructing resource list from fake discovery client: %v", err)
}
restMapper := discovery.NewRESTMapper(restMapperRes, apimeta.InterfacesForUnstructured)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ func TestSetRotationDeadline(t *testing.T) {
t.Errorf("%d metrics were recorded, wanted %d", g.calls, 1)
}
if g.lastValue != float64(tc.notAfter.Unix()) {
t.Errorf("%d value for metric was recorded, wanted %d", g.lastValue, tc.notAfter.Unix())
t.Errorf("%f value for metric was recorded, wanted %d", g.lastValue, tc.notAfter.Unix())
}
})
}
Expand Down