mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
fix some syntax related errors
This commit is contained in:
parent
317853c90c
commit
d065157dd7
@ -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 {
|
||||
@ -294,7 +294,7 @@ 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())
|
||||
}
|
||||
}
|
||||
|
||||
@ -302,7 +302,7 @@ values:
|
||||
{
|
||||
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").
|
||||
|
@ -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())
|
||||
@ -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())
|
||||
@ -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())
|
||||
|
@ -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
|
||||
|
@ -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"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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 (
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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())
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user