mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 12:43:23 +00:00
fix some syntax related errors
This commit is contained in:
parent
317853c90c
commit
d065157dd7
@ -232,7 +232,7 @@ values:
|
|||||||
Param("watch", "true").
|
Param("watch", "true").
|
||||||
DoRaw()
|
DoRaw()
|
||||||
if !errors.IsNotAcceptable(err) {
|
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)
|
obj, err := decodeYAML(result)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -294,7 +294,7 @@ values:
|
|||||||
t.Fatal(v, ok, err, string(result))
|
t.Fatal(v, ok, err, string(result))
|
||||||
}
|
}
|
||||||
if obj.GetUID() != uid {
|
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(`
|
yamlBody := []byte(fmt.Sprintf(`
|
||||||
values:
|
values:
|
||||||
numVal: 3`, apiVersion, kind, uid, resourceVersion))
|
numVal: 3`))
|
||||||
result, err := rest.Patch(types.MergePatchType).
|
result, err := rest.Patch(types.MergePatchType).
|
||||||
SetHeader("Accept", "application/yaml").
|
SetHeader("Accept", "application/yaml").
|
||||||
SetHeader("Content-Type", "application/yaml").
|
SetHeader("Content-Type", "application/yaml").
|
||||||
|
@ -623,7 +623,7 @@ func TestFailGettingIPv4Routes(t *testing.T) {
|
|||||||
errStrFrag := "no such file"
|
errStrFrag := "no such file"
|
||||||
_, err := v4File.extract()
|
_, err := v4File.extract()
|
||||||
if err == nil {
|
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) {
|
if !strings.Contains(err.Error(), errStrFrag) {
|
||||||
t.Errorf("Unable to find %q in error string %q", errStrFrag, err.Error())
|
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"
|
errStrFrag := "no such file"
|
||||||
_, err := v6File.extract()
|
_, err := v6File.extract()
|
||||||
if err == nil {
|
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) {
|
if !strings.Contains(err.Error(), errStrFrag) {
|
||||||
t.Errorf("Unable to find %q in error string %q", errStrFrag, err.Error())
|
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"
|
errStrFrag := "no such file"
|
||||||
_, err := getAllDefaultRoutes()
|
_, err := getAllDefaultRoutes()
|
||||||
if err == nil {
|
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) {
|
if !strings.Contains(err.Error(), errStrFrag) {
|
||||||
t.Errorf("Unable to find %q in error string %q", errStrFrag, err.Error())
|
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
|
// when empty, record is stored
|
||||||
cache.set("foo", record1, time.Hour)
|
cache.set("foo", record1, time.Hour)
|
||||||
if result, ok := cache.get("foo"); !ok || result != record1 {
|
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
|
// newer record overrides
|
||||||
cache.set("foo", record2, time.Hour)
|
cache.set("foo", record2, time.Hour)
|
||||||
if result, ok := cache.get("foo"); !ok || result != record2 {
|
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
|
// removing the current value removes
|
||||||
|
@ -848,7 +848,7 @@ func TestAuditIDHttpHeader(t *testing.T) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if resp.Header.Get("Audit-ID") != "" {
|
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.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Package envelope transforms values for storage at rest using a Envelope provider
|
||||||
|
|
||||||
// +build !windows
|
// +build !windows
|
||||||
|
|
||||||
// Package envelope transforms values for storage at rest using a Envelope provider
|
|
||||||
package envelope
|
package envelope
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -99,7 +99,7 @@ func fakeScaleClient(t *testing.T) (ScalesGetter, []schema.GroupResource) {
|
|||||||
|
|
||||||
restMapperRes, err := discovery.GetAPIGroupResources(fakeDiscoveryClient)
|
restMapperRes, err := discovery.GetAPIGroupResources(fakeDiscoveryClient)
|
||||||
if err != nil {
|
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)
|
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)
|
t.Errorf("%d metrics were recorded, wanted %d", g.calls, 1)
|
||||||
}
|
}
|
||||||
if g.lastValue != float64(tc.notAfter.Unix()) {
|
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