mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-06 02:34:03 +00:00
replace spew methods with dump methods
This commit is contained in:
parent
c3e3ff989a
commit
c4e1b01416
2
go.mod
2
go.mod
@ -26,7 +26,6 @@ require (
|
||||
github.com/coreos/go-systemd/v22 v22.4.0
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.2
|
||||
github.com/cyphar/filepath-securejoin v0.2.3
|
||||
github.com/davecgh/go-spew v1.1.1
|
||||
github.com/docker/distribution v2.8.1+incompatible
|
||||
github.com/docker/go-units v0.5.0
|
||||
github.com/emicklei/go-restful/v3 v3.9.0
|
||||
@ -154,6 +153,7 @@ require (
|
||||
github.com/containerd/ttrpc v1.1.0 // indirect
|
||||
github.com/coredns/caddy v1.1.0 // indirect
|
||||
github.com/coreos/go-semver v0.3.0 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/daviddengcn/go-colortext v1.0.0 // indirect
|
||||
github.com/dustin/go-humanize v1.0.0 // indirect
|
||||
github.com/euank/go-kmsg-parser v2.0.0+incompatible // indirect
|
||||
|
@ -20,9 +20,7 @@ import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
|
||||
"k8s.io/api/core/v1"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/client-go/informers"
|
||||
@ -34,10 +32,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/controller"
|
||||
)
|
||||
|
||||
func init() {
|
||||
spew.Config.DisableMethods = true
|
||||
}
|
||||
|
||||
const testTokenID = "abc123"
|
||||
|
||||
func newSigner() (*Signer, *fake.Clientset, coreinformers.SecretInformer, coreinformers.ConfigMapInformer, error) {
|
||||
|
@ -19,11 +19,10 @@ package bootstrap
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
|
||||
"k8s.io/api/core/v1"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/apimachinery/pkg/util/dump"
|
||||
core "k8s.io/client-go/testing"
|
||||
bootstrapapi "k8s.io/cluster-bootstrap/token/api"
|
||||
"k8s.io/kubernetes/pkg/apis/core/helper"
|
||||
@ -56,13 +55,13 @@ func addSecretSigningUsage(s *v1.Secret, value string) {
|
||||
func verifyActions(t *testing.T, expected, actual []core.Action) {
|
||||
for i, a := range actual {
|
||||
if len(expected) < i+1 {
|
||||
t.Errorf("%d unexpected actions: %s", len(actual)-len(expected), spew.Sdump(actual[i:]))
|
||||
t.Errorf("%d unexpected actions: %s", len(actual)-len(expected), dump.Pretty(actual[i:]))
|
||||
break
|
||||
}
|
||||
|
||||
e := expected[i]
|
||||
if !helper.Semantic.DeepEqual(e, a) {
|
||||
t.Errorf("Expected\n\t%s\ngot\n\t%s", spew.Sdump(e), spew.Sdump(a))
|
||||
t.Errorf("Expected\n\t%s\ngot\n\t%s", dump.Pretty(e), dump.Pretty(a))
|
||||
continue
|
||||
}
|
||||
}
|
||||
@ -70,7 +69,7 @@ func verifyActions(t *testing.T, expected, actual []core.Action) {
|
||||
if len(expected) > len(actual) {
|
||||
t.Errorf("%d additional expected actions", len(expected)-len(actual))
|
||||
for _, a := range expected[len(actual):] {
|
||||
t.Logf(" %s", spew.Sdump(a))
|
||||
t.Logf(" %s", dump.Pretty(a))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,8 +21,6 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/util/wait"
|
||||
@ -33,10 +31,6 @@ import (
|
||||
api "k8s.io/kubernetes/pkg/apis/core"
|
||||
)
|
||||
|
||||
func init() {
|
||||
spew.Config.DisableMethods = true
|
||||
}
|
||||
|
||||
func newTokenCleaner() (*TokenCleaner, *fake.Clientset, coreinformers.SecretInformer, error) {
|
||||
options := DefaultTokenCleanerOptions()
|
||||
cl := fake.NewSimpleClientset()
|
||||
|
@ -22,11 +22,11 @@ import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/google/go-cmp/cmp"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/apimachinery/pkg/util/dump"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -338,23 +338,23 @@ func TestToDOTGraphObj(t *testing.T) {
|
||||
|
||||
func compareGraphs(expectedNodes, actualNodes []*dotVertex, expectedEdges, actualEdges []dotEdge, t *testing.T) {
|
||||
if len(expectedNodes) != len(actualNodes) {
|
||||
t.Fatal(spew.Sdump(actualNodes))
|
||||
t.Fatal(dump.Pretty(actualNodes))
|
||||
}
|
||||
for i := range expectedNodes {
|
||||
currExpected := expectedNodes[i]
|
||||
currActual := actualNodes[i]
|
||||
if currExpected.uid != currActual.uid {
|
||||
t.Errorf("expected %v, got %v", spew.Sdump(currExpected), spew.Sdump(currActual))
|
||||
t.Errorf("expected %v, got %v", dump.Pretty(currExpected), dump.Pretty(currActual))
|
||||
}
|
||||
}
|
||||
if len(expectedEdges) != len(actualEdges) {
|
||||
t.Fatal(spew.Sdump(actualEdges))
|
||||
t.Fatal(dump.Pretty(actualEdges))
|
||||
}
|
||||
for i := range expectedEdges {
|
||||
currExpected := expectedEdges[i]
|
||||
currActual := actualEdges[i]
|
||||
if currExpected != currActual {
|
||||
t.Errorf("expected %v, got %v", spew.Sdump(currExpected), spew.Sdump(currActual))
|
||||
t.Errorf("expected %v, got %v", dump.Pretty(currExpected), dump.Pretty(currActual))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,12 +21,12 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"gopkg.in/square/go-jose.v2/jwt"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/util/dump"
|
||||
utilrand "k8s.io/apimachinery/pkg/util/rand"
|
||||
"k8s.io/client-go/informers"
|
||||
"k8s.io/client-go/kubernetes/fake"
|
||||
@ -547,7 +547,7 @@ func TestTokenCreation(t *testing.T) {
|
||||
|
||||
expectedAction := tc.ExpectedActions[i]
|
||||
if !reflect.DeepEqual(expectedAction, action) {
|
||||
t.Errorf("%s:\nExpected:\n%s\ngot:\n%s", k, spew.Sdump(expectedAction), spew.Sdump(action))
|
||||
t.Errorf("%s:\nExpected:\n%s\ngot:\n%s", k, dump.Pretty(expectedAction), dump.Pretty(action))
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
@ -23,8 +23,6 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
|
||||
v1 "k8s.io/api/core/v1"
|
||||
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/api/meta"
|
||||
@ -32,6 +30,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/apimachinery/pkg/util/dump"
|
||||
"k8s.io/client-go/informers"
|
||||
"k8s.io/client-go/kubernetes/fake"
|
||||
clienttesting "k8s.io/client-go/testing"
|
||||
@ -470,13 +469,13 @@ func TestPVCProtectionController(t *testing.T) {
|
||||
actions := client.Actions()
|
||||
for i, action := range actions {
|
||||
if len(test.expectedActions) < i+1 {
|
||||
t.Errorf("Test %q: %d unexpected actions: %+v", test.name, len(actions)-len(test.expectedActions), spew.Sdump(actions[i:]))
|
||||
t.Errorf("Test %q: %d unexpected actions: %+v", test.name, len(actions)-len(test.expectedActions), dump.Pretty(actions[i:]))
|
||||
break
|
||||
}
|
||||
|
||||
expectedAction := test.expectedActions[i]
|
||||
if !reflect.DeepEqual(expectedAction, action) {
|
||||
t.Errorf("Test %q: action %d\nExpected:\n%s\ngot:\n%s", test.name, i, spew.Sdump(expectedAction), spew.Sdump(action))
|
||||
t.Errorf("Test %q: action %d\nExpected:\n%s\ngot:\n%s", test.name, i, dump.Pretty(expectedAction), dump.Pretty(action))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23,14 +23,13 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
|
||||
v1 "k8s.io/api/core/v1"
|
||||
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/api/meta"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/util/dump"
|
||||
"k8s.io/client-go/informers"
|
||||
"k8s.io/client-go/kubernetes/fake"
|
||||
clienttesting "k8s.io/client-go/testing"
|
||||
@ -252,7 +251,7 @@ func TestPVProtectionController(t *testing.T) {
|
||||
actions := client.Actions()
|
||||
|
||||
if !reflect.DeepEqual(actions, test.expectedActions) {
|
||||
t.Errorf("Test %q: action not expected\nExpected:\n%s\ngot:\n%s", test.name, spew.Sdump(test.expectedActions), spew.Sdump(actions))
|
||||
t.Errorf("Test %q: action not expected\nExpected:\n%s\ngot:\n%s", test.name, dump.Pretty(test.expectedActions), dump.Pretty(actions))
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -20,7 +20,6 @@ import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/google/go-cmp/cmp"
|
||||
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
@ -28,6 +27,7 @@ import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/util/dump"
|
||||
"k8s.io/apimachinery/pkg/util/validation/field"
|
||||
"k8s.io/apiserver/pkg/authentication/request/headerrequest"
|
||||
"k8s.io/apiserver/pkg/server/dynamiccertificates"
|
||||
@ -312,7 +312,7 @@ func getFinalConfigMaps(t *testing.T, client *fake.Clientset) (map[string]*corev
|
||||
created := false
|
||||
|
||||
for _, action := range client.Actions() {
|
||||
t.Log(spew.Sdump(action))
|
||||
t.Log(dump.Pretty(action))
|
||||
if action.Matches("create", "configmaps") {
|
||||
created = true
|
||||
obj := action.(clienttesting.CreateAction).GetObject().(*corev1.ConfigMap)
|
||||
|
@ -25,11 +25,10 @@ import (
|
||||
"time"
|
||||
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/apimachinery/pkg/util/dump"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
utilproxy "k8s.io/kubernetes/pkg/proxy/util"
|
||||
testingclock "k8s.io/utils/clock/testing"
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
)
|
||||
|
||||
type fakeListener struct {
|
||||
@ -176,10 +175,10 @@ func TestServer(t *testing.T) {
|
||||
t.Errorf("expected 0 endpoints, got %d", hcs.services[nsn].endpoints)
|
||||
}
|
||||
if len(listener.openPorts) != 1 {
|
||||
t.Errorf("expected 1 open port, got %d\n%s", len(listener.openPorts), spew.Sdump(listener.openPorts))
|
||||
t.Errorf("expected 1 open port, got %d\n%s", len(listener.openPorts), dump.Pretty(listener.openPorts))
|
||||
}
|
||||
if !listener.hasPort(":9376") {
|
||||
t.Errorf("expected port :9376 to be open\n%s", spew.Sdump(listener.openPorts))
|
||||
t.Errorf("expected port :9376 to be open\n%s", dump.Pretty(listener.openPorts))
|
||||
}
|
||||
// test the handler
|
||||
testHandler(hcs, nsn, http.StatusServiceUnavailable, 0, t)
|
||||
@ -262,7 +261,7 @@ func TestServer(t *testing.T) {
|
||||
t.Errorf("expected 0 endpoints, got %d", hcs.services[nsn3].endpoints)
|
||||
}
|
||||
if len(listener.openPorts) != 3 {
|
||||
t.Errorf("expected 3 open ports, got %d\n%s", len(listener.openPorts), spew.Sdump(listener.openPorts))
|
||||
t.Errorf("expected 3 open ports, got %d\n%s", len(listener.openPorts), dump.Pretty(listener.openPorts))
|
||||
}
|
||||
// test the handlers
|
||||
testHandler(hcs, nsn1, http.StatusServiceUnavailable, 0, t)
|
||||
@ -505,10 +504,10 @@ func TestServerWithSelectiveListeningAddress(t *testing.T) {
|
||||
t.Errorf("expected 0 endpoints, got %d", hcs.services[nsn].endpoints)
|
||||
}
|
||||
if len(listener.openPorts) != 1 {
|
||||
t.Errorf("expected 1 open port, got %d\n%s", len(listener.openPorts), spew.Sdump(listener.openPorts))
|
||||
t.Errorf("expected 1 open port, got %d\n%s", len(listener.openPorts), dump.Pretty(listener.openPorts))
|
||||
}
|
||||
if !listener.hasPort("127.0.0.1:9376") {
|
||||
t.Errorf("expected port :9376 to be open\n%s", spew.Sdump(listener.openPorts))
|
||||
t.Errorf("expected port :9376 to be open\n%s", dump.Pretty(listener.openPorts))
|
||||
}
|
||||
// test the handler
|
||||
testHandler(hcs, nsn, http.StatusServiceUnavailable, 0, t)
|
||||
|
@ -21,11 +21,10 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
|
||||
v1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/apimachinery/pkg/util/dump"
|
||||
"k8s.io/apimachinery/pkg/util/intstr"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
netutils "k8s.io/utils/net"
|
||||
@ -470,7 +469,7 @@ func TestServiceToServiceMap(t *testing.T) {
|
||||
newServices := svcTracker.serviceToServiceMap(tc.service)
|
||||
|
||||
if len(newServices) != len(tc.expected) {
|
||||
t.Fatalf("expected %d new, got %d: %v", len(tc.expected), len(newServices), spew.Sdump(newServices))
|
||||
t.Fatalf("expected %d new, got %d: %v", len(tc.expected), len(newServices), dump.Pretty(newServices))
|
||||
}
|
||||
for svcKey, expectedInfo := range tc.expected {
|
||||
svcInfo, exists := newServices[svcKey].(*BaseServicePortInfo)
|
||||
|
@ -21,11 +21,10 @@ import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/util/dump"
|
||||
"k8s.io/apiserver/pkg/admission"
|
||||
api "k8s.io/kubernetes/pkg/apis/core"
|
||||
volumeutil "k8s.io/kubernetes/pkg/volume/util"
|
||||
@ -117,7 +116,7 @@ func TestAdmit(t *testing.T) {
|
||||
t.Errorf("Test %q: got unexpected error: %v", test.name, err)
|
||||
}
|
||||
if !reflect.DeepEqual(test.expectedObject, obj) {
|
||||
t.Errorf("Test %q: Expected object:\n%s\ngot:\n%s", test.name, spew.Sdump(test.expectedObject), spew.Sdump(obj))
|
||||
t.Errorf("Test %q: Expected object:\n%s\ngot:\n%s", test.name, dump.Pretty(test.expectedObject), dump.Pretty(obj))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -21,8 +21,8 @@ import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/evanphx/json-patch"
|
||||
jsonpatch "github.com/evanphx/json-patch"
|
||||
"k8s.io/apimachinery/pkg/util/dump"
|
||||
"k8s.io/apimachinery/pkg/util/json"
|
||||
"sigs.k8s.io/yaml"
|
||||
)
|
||||
@ -733,7 +733,7 @@ func jsonToYAMLOrError(j []byte) string {
|
||||
func toJSON(v interface{}) ([]byte, error) {
|
||||
j, err := json.Marshal(v)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("json marshal failed: %v\n%v\n", err, spew.Sdump(v))
|
||||
return nil, fmt.Errorf("json marshal failed: %v\n%v\n", err, dump.Pretty(v))
|
||||
}
|
||||
return j, nil
|
||||
}
|
||||
|
@ -23,10 +23,10 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"sigs.k8s.io/yaml"
|
||||
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/util/dump"
|
||||
"k8s.io/apimachinery/pkg/util/json"
|
||||
"k8s.io/apimachinery/pkg/util/mergepatch"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
@ -6365,7 +6365,7 @@ func jsonToYAMLOrError(j []byte) string {
|
||||
func toJSON(v interface{}) ([]byte, error) {
|
||||
j, err := json.Marshal(v)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("json marshal failed: %v\n%v\n", err, spew.Sdump(v))
|
||||
return nil, fmt.Errorf("json marshal failed: %v\n%v\n", err, dump.Pretty(v))
|
||||
}
|
||||
|
||||
return j, nil
|
||||
|
@ -7,7 +7,6 @@ go 1.20
|
||||
require (
|
||||
github.com/coreos/go-oidc v2.1.0+incompatible
|
||||
github.com/coreos/go-systemd/v22 v22.4.0
|
||||
github.com/davecgh/go-spew v1.1.1
|
||||
github.com/emicklei/go-restful/v3 v3.9.0
|
||||
github.com/evanphx/json-patch v4.12.0+incompatible
|
||||
github.com/fsnotify/fsnotify v1.6.0
|
||||
@ -66,6 +65,7 @@ require (
|
||||
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.1.2 // indirect
|
||||
github.com/coreos/go-semver v0.3.0 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/dustin/go-humanize v1.0.0 // indirect
|
||||
github.com/felixge/httpsnoop v1.0.3 // indirect
|
||||
github.com/go-logr/logr v1.2.3 // indirect
|
||||
|
@ -21,9 +21,9 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/util/dump"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
"k8s.io/apimachinery/pkg/version"
|
||||
"k8s.io/apiserver/pkg/registry/rest"
|
||||
@ -330,7 +330,7 @@ func Test_removeDeletedKinds(t *testing.T) {
|
||||
convertor := &dummyConvertor{}
|
||||
tt.resourceExpirationEvaluator.RemoveDeletedKinds("group.name", convertor, tt.versionedResourcesStorageMap)
|
||||
if !reflect.DeepEqual(tt.expectedStorage, tt.versionedResourcesStorageMap) {
|
||||
t.Fatal(spew.Sdump(tt.versionedResourcesStorageMap))
|
||||
t.Fatal(dump.Pretty(tt.versionedResourcesStorageMap))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"k8s.io/apimachinery/pkg/util/dump"
|
||||
)
|
||||
|
||||
var serverKey = []byte(`-----BEGIN RSA PRIVATE KEY-----
|
||||
@ -114,7 +114,7 @@ func TestNewStaticCertKeyContent(t *testing.T) {
|
||||
}
|
||||
actual, err := c.newTLSContent()
|
||||
if !reflect.DeepEqual(actual, test.expected) {
|
||||
t.Error(spew.Sdump(actual))
|
||||
t.Error(dump.Pretty(actual))
|
||||
}
|
||||
switch {
|
||||
case err == nil && len(test.expectedErr) == 0:
|
||||
|
@ -5,7 +5,6 @@ module k8s.io/cli-runtime
|
||||
go 1.20
|
||||
|
||||
require (
|
||||
github.com/davecgh/go-spew v1.1.1
|
||||
github.com/evanphx/json-patch v4.12.0+incompatible
|
||||
github.com/google/gnostic v0.5.7-v3refs
|
||||
github.com/google/go-cmp v0.5.9
|
||||
@ -28,6 +27,7 @@ require (
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
|
||||
github.com/go-errors/errors v1.4.2 // indirect
|
||||
github.com/go-logr/logr v1.2.3 // indirect
|
||||
|
@ -30,7 +30,6 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"sigs.k8s.io/yaml"
|
||||
|
||||
apiequality "k8s.io/apimachinery/pkg/api/equality"
|
||||
@ -41,6 +40,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/runtime/serializer/streaming"
|
||||
"k8s.io/apimachinery/pkg/util/dump"
|
||||
utilerrors "k8s.io/apimachinery/pkg/util/errors"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/rest"
|
||||
@ -542,11 +542,11 @@ func TestPathBuilderWithMultiple(t *testing.T) {
|
||||
switch tt.object.(type) {
|
||||
case *v1.Pod:
|
||||
if _, ok := v.Object.(*v1.Pod); !ok || v.Name != tt.expectedNames[i] || v.Namespace != "test" {
|
||||
t.Errorf("unexpected info: %v", spew.Sdump(v.Object))
|
||||
t.Errorf("unexpected info: %v", dump.Pretty(v.Object))
|
||||
}
|
||||
case *v1.ReplicationController:
|
||||
if _, ok := v.Object.(*v1.ReplicationController); !ok || v.Name != tt.expectedNames[i] || v.Namespace != "test" {
|
||||
t.Errorf("unexpected info: %v", spew.Sdump(v.Object))
|
||||
t.Errorf("unexpected info: %v", dump.Pretty(v.Object))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,10 +17,11 @@ limitations under the License.
|
||||
package resource
|
||||
|
||||
import (
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"testing"
|
||||
|
||||
"k8s.io/apimachinery/pkg/util/dump"
|
||||
"sigs.k8s.io/kustomize/api/konfig"
|
||||
"sigs.k8s.io/kustomize/kyaml/filesys"
|
||||
"testing"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -151,7 +152,7 @@ func TestKustomizeVisitor(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if len(tv.Infos) != 4 {
|
||||
t.Fatal(spew.Sdump(tv.Infos))
|
||||
t.Fatal(dump.Pretty(tv.Infos))
|
||||
}
|
||||
if string(kv.yml) != expectedContent {
|
||||
t.Fatalf("expected:\n%s\nbut got:\n%s", expectedContent, string(kv.yml))
|
||||
|
@ -29,8 +29,8 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"k8s.io/apimachinery/pkg/util/dump"
|
||||
)
|
||||
|
||||
func TestVisitorHttpGet(t *testing.T) {
|
||||
@ -182,7 +182,7 @@ func TestFlattenListVisitor(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if len(test.Infos) != 6 {
|
||||
t.Fatal(spew.Sdump(test.Infos))
|
||||
t.Fatal(dump.Pretty(test.Infos))
|
||||
}
|
||||
}
|
||||
|
||||
@ -197,7 +197,7 @@ func TestFlattenListVisitorWithVisitorError(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if len(test.Infos) != 6 {
|
||||
t.Fatal(spew.Sdump(test.Infos))
|
||||
t.Fatal(dump.Pretty(test.Infos))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,6 @@ module k8s.io/client-go
|
||||
go 1.20
|
||||
|
||||
require (
|
||||
github.com/davecgh/go-spew v1.1.1
|
||||
github.com/evanphx/json-patch v4.12.0+incompatible
|
||||
github.com/gogo/protobuf v1.3.2
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
|
||||
@ -35,6 +34,7 @@ require (
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
|
||||
github.com/go-logr/logr v1.2.3 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.19.6 // indirect
|
||||
|
@ -23,10 +23,9 @@ import (
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
|
||||
appsv1 "k8s.io/api/apps/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/util/dump"
|
||||
"k8s.io/client-go/kubernetes"
|
||||
"k8s.io/client-go/kubernetes/scheme"
|
||||
"k8s.io/client-go/rest"
|
||||
@ -39,7 +38,7 @@ func TestListTimeout(t *testing.T) {
|
||||
NegotiatedSerializer: scheme.Codecs,
|
||||
Client: manualfake.CreateHTTPClient(func(req *http.Request) (*http.Response, error) {
|
||||
if req.URL.Query().Get("timeout") != "21s" {
|
||||
t.Fatal(spew.Sdump(req.URL.Query()))
|
||||
t.Fatal(dump.Pretty(req.URL.Query()))
|
||||
}
|
||||
return &http.Response{StatusCode: http.StatusNotFound, Body: io.NopCloser(&bytes.Buffer{})}, nil
|
||||
}),
|
||||
|
@ -21,10 +21,10 @@ import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/util/dump"
|
||||
"k8s.io/apimachinery/pkg/version"
|
||||
. "k8s.io/client-go/discovery"
|
||||
"k8s.io/client-go/openapi"
|
||||
@ -364,7 +364,7 @@ func TestGetAPIGroupResources(t *testing.T) {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
if !reflect.DeepEqual(test.expected, got) {
|
||||
t.Errorf("unexpected result:\nexpected = %s\ngot = %s", spew.Sdump(test.expected), spew.Sdump(got))
|
||||
t.Errorf("unexpected result:\nexpected = %s\ngot = %s", dump.Pretty(test.expected), dump.Pretty(got))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -24,7 +24,6 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/google/go-cmp/cmp"
|
||||
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
@ -32,6 +31,7 @@ import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/util/dump"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
fakeclientset "k8s.io/client-go/kubernetes/fake"
|
||||
testcore "k8s.io/client-go/testing"
|
||||
@ -260,7 +260,7 @@ func TestNewInformerWatcher(t *testing.T) {
|
||||
sort.Sort(byEventTypeAndName(result))
|
||||
|
||||
if !reflect.DeepEqual(expected, result) {
|
||||
t.Error(spew.Errorf("\nexpected: %#v,\ngot: %#v,\ndiff: %s", expected, result, cmp.Diff(expected, result)))
|
||||
t.Errorf("\nexpected: %s,\ngot: %s,\ndiff: %s", dump.Pretty(expected), dump.Pretty(result), cmp.Diff(expected, result))
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -26,13 +26,13 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/google/go-cmp/cmp"
|
||||
|
||||
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/util/dump"
|
||||
"k8s.io/apimachinery/pkg/util/wait"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
@ -530,7 +530,7 @@ func TestRetryWatcher(t *testing.T) {
|
||||
for i := 0; i < len(tc.expected); i++ {
|
||||
event, ok := <-watcher.ResultChan()
|
||||
if !ok {
|
||||
t.Error(spew.Errorf("expected event %#+v, but channel is closed"), tc.expected[i])
|
||||
t.Errorf("expected event %s, but channel is closed", dump.Pretty(tc.expected[i]))
|
||||
break
|
||||
}
|
||||
|
||||
@ -544,7 +544,7 @@ func TestRetryWatcher(t *testing.T) {
|
||||
select {
|
||||
case event, ok := <-watcher.ResultChan():
|
||||
if ok {
|
||||
t.Error(spew.Errorf("Unexpected event received after reading all the expected ones: %#+v", event))
|
||||
t.Errorf("Unexpected event received after reading all the expected ones: %s", dump.Pretty(event))
|
||||
}
|
||||
case <-time.After(10 * time.Millisecond):
|
||||
break
|
||||
@ -564,7 +564,7 @@ func TestRetryWatcher(t *testing.T) {
|
||||
}
|
||||
|
||||
if !reflect.DeepEqual(tc.expected, got) {
|
||||
t.Fatal(spew.Errorf("expected %#+v, got %#+v;\ndiff: %s", tc.expected, got, cmp.Diff(tc.expected, got)))
|
||||
t.Fatalf("expected %s, got %s;\ndiff: %s", dump.Pretty(tc.expected), dump.Pretty(got), cmp.Diff(tc.expected, got))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -19,8 +19,8 @@ package app
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
admissionv1 "k8s.io/api/admission/v1"
|
||||
"k8s.io/apimachinery/pkg/util/dump"
|
||||
"k8s.io/cloud-provider/app/config"
|
||||
cpconfig "k8s.io/cloud-provider/config"
|
||||
"k8s.io/cloud-provider/fake"
|
||||
@ -103,10 +103,10 @@ func TestWebhookEnableDisable(t *testing.T) {
|
||||
t.Fatalf(
|
||||
"FAILED: %q\n---\nActual:\n%s\nExpected:\n%s\ntc.webhookConfigs:\n%s\ntc.completedConfig:\n%s\n",
|
||||
tc.desc,
|
||||
spew.Sdump(actual),
|
||||
spew.Sdump(tc.expected),
|
||||
spew.Sdump(tc.webhookConfigs),
|
||||
spew.Sdump(tc.completedConfig),
|
||||
dump.Pretty(actual),
|
||||
dump.Pretty(tc.expected),
|
||||
dump.Pretty(tc.webhookConfigs),
|
||||
dump.Pretty(tc.completedConfig),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,6 @@ module k8s.io/cloud-provider
|
||||
go 1.20
|
||||
|
||||
require (
|
||||
github.com/davecgh/go-spew v1.1.1
|
||||
github.com/google/go-cmp v0.5.9
|
||||
github.com/spf13/cobra v1.6.0
|
||||
github.com/spf13/pflag v1.0.5
|
||||
@ -32,6 +31,7 @@ require (
|
||||
github.com/cespare/xxhash/v2 v2.1.2 // indirect
|
||||
github.com/coreos/go-semver v0.3.0 // indirect
|
||||
github.com/coreos/go-systemd/v22 v22.4.0 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
|
||||
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
|
||||
github.com/felixge/httpsnoop v1.0.3 // indirect
|
||||
|
@ -5,7 +5,6 @@ module k8s.io/kube-aggregator
|
||||
go 1.20
|
||||
|
||||
require (
|
||||
github.com/davecgh/go-spew v1.1.1
|
||||
github.com/emicklei/go-restful/v3 v3.9.0
|
||||
github.com/gogo/protobuf v1.3.2
|
||||
github.com/google/go-cmp v0.5.9
|
||||
@ -36,6 +35,7 @@ require (
|
||||
github.com/cespare/xxhash/v2 v2.1.2 // indirect
|
||||
github.com/coreos/go-semver v0.3.0 // indirect
|
||||
github.com/coreos/go-systemd/v22 v22.4.0 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
|
||||
github.com/felixge/httpsnoop v1.0.3 // indirect
|
||||
github.com/fsnotify/fsnotify v1.6.0 // indirect
|
||||
|
@ -28,10 +28,9 @@ import (
|
||||
|
||||
"k8s.io/utils/pointer"
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
|
||||
v1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/util/dump"
|
||||
v1listers "k8s.io/client-go/listers/core/v1"
|
||||
clienttesting "k8s.io/client-go/testing"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
@ -503,13 +502,13 @@ func TestUpdateAPIServiceStatus(t *testing.T) {
|
||||
|
||||
c.updateAPIServiceStatus(foo, foo)
|
||||
if e, a := 0, len(fakeClient.Actions()); e != a {
|
||||
t.Error(spew.Sdump(fakeClient.Actions()))
|
||||
t.Error(dump.Pretty(fakeClient.Actions()))
|
||||
}
|
||||
|
||||
fakeClient.ClearActions()
|
||||
c.updateAPIServiceStatus(foo, bar)
|
||||
if e, a := 1, len(fakeClient.Actions()); e != a {
|
||||
t.Error(spew.Sdump(fakeClient.Actions()))
|
||||
t.Error(dump.Pretty(fakeClient.Actions()))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -32,6 +32,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/fields"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/util/dump"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
watchtools "k8s.io/client-go/tools/watch"
|
||||
@ -41,7 +42,6 @@ import (
|
||||
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
||||
admissionapi "k8s.io/pod-security-admission/api"
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/onsi/ginkgo/v2"
|
||||
"github.com/onsi/gomega"
|
||||
"github.com/opencontainers/runc/libcontainer/apparmor"
|
||||
@ -64,7 +64,7 @@ var _ = SIGDescribe("AppArmor [Feature:AppArmor][NodeFeature:AppArmor]", func()
|
||||
ginkgo.It("should enforce a profile blocking writes", func(ctx context.Context) {
|
||||
status := runAppArmorTest(ctx, f, true, v1.AppArmorBetaProfileNamePrefix+apparmorProfilePrefix+"deny-write")
|
||||
if len(status.ContainerStatuses) == 0 {
|
||||
framework.Failf("Unexpected pod status: %s", spew.Sdump(status))
|
||||
framework.Failf("Unexpected pod status: %s", dump.Pretty(status))
|
||||
return
|
||||
}
|
||||
state := status.ContainerStatuses[0].State.Terminated
|
||||
@ -75,7 +75,7 @@ var _ = SIGDescribe("AppArmor [Feature:AppArmor][NodeFeature:AppArmor]", func()
|
||||
ginkgo.It("should enforce a permissive profile", func(ctx context.Context) {
|
||||
status := runAppArmorTest(ctx, f, true, v1.AppArmorBetaProfileNamePrefix+apparmorProfilePrefix+"audit-write")
|
||||
if len(status.ContainerStatuses) == 0 {
|
||||
framework.Failf("Unexpected pod status: %s", spew.Sdump(status))
|
||||
framework.Failf("Unexpected pod status: %s", dump.Pretty(status))
|
||||
return
|
||||
}
|
||||
state := status.ContainerStatuses[0].State.Terminated
|
||||
|
@ -21,11 +21,11 @@ import (
|
||||
|
||||
v1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/util/dump"
|
||||
"k8s.io/kubernetes/test/e2e/framework"
|
||||
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
||||
admissionapi "k8s.io/pod-security-admission/api"
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/onsi/ginkgo/v2"
|
||||
"github.com/onsi/gomega"
|
||||
)
|
||||
@ -62,7 +62,7 @@ var _ = SIGDescribe("ImageID [NodeFeature: ImageID]", func() {
|
||||
status := runningPod.Status
|
||||
|
||||
if len(status.ContainerStatuses) == 0 {
|
||||
framework.Failf("Unexpected pod status; %s", spew.Sdump(status))
|
||||
framework.Failf("Unexpected pod status; %s", dump.Pretty(status))
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -23,12 +23,11 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
|
||||
appsv1 "k8s.io/api/apps/v1"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
"k8s.io/apimachinery/pkg/util/dump"
|
||||
"k8s.io/apimachinery/pkg/util/wait"
|
||||
"k8s.io/client-go/dynamic"
|
||||
"k8s.io/client-go/informers"
|
||||
@ -112,7 +111,7 @@ func TestNamespaceCondition(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
t.Log(spew.Sdump(curr))
|
||||
t.Log(dump.Pretty(curr))
|
||||
return conditionsFound == 5, nil
|
||||
})
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user