diff --git a/go.mod b/go.mod index b6fe808c1..bc6f10ca7 100644 --- a/go.mod +++ b/go.mod @@ -31,10 +31,10 @@ require ( golang.org/x/sys v0.5.0 gopkg.in/yaml.v2 v2.4.0 k8s.io/api v0.0.0-20230303235756-fc1b77c3f4ab - k8s.io/apimachinery v0.0.0-20230303235433-5b1cff80ea06 - k8s.io/cli-runtime v0.0.0-20230304005623-a18cae8f8d12 - k8s.io/client-go v0.0.0-20230304000202-d39f8291fc57 - k8s.io/component-base v0.0.0-20230304000858-ddedd087ad1e + k8s.io/apimachinery v0.0.0-20230303235435-f357b1fa74b7 + k8s.io/cli-runtime v0.0.0-20230304005626-589dfd9f4f89 + k8s.io/client-go v0.0.0-20230304000204-06ad6b391d35 + k8s.io/component-base v0.0.0-20230304000900-3bf8af940f29 k8s.io/component-helpers v0.0.0-20230304001010-94a6fd9a7905 k8s.io/klog/v2 v2.90.1 k8s.io/kube-openapi v0.0.0-20230303024457-afdc3dddf62d @@ -92,11 +92,11 @@ require ( replace ( k8s.io/api => k8s.io/api v0.0.0-20230303235756-fc1b77c3f4ab - k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20230303235433-5b1cff80ea06 - k8s.io/cli-runtime => k8s.io/cli-runtime v0.0.0-20230304005623-a18cae8f8d12 - k8s.io/client-go => k8s.io/client-go v0.0.0-20230304000202-d39f8291fc57 + k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20230303235435-f357b1fa74b7 + k8s.io/cli-runtime => k8s.io/cli-runtime v0.0.0-20230304005626-589dfd9f4f89 + k8s.io/client-go => k8s.io/client-go v0.0.0-20230304000204-06ad6b391d35 k8s.io/code-generator => k8s.io/code-generator v0.0.0-20230303235006-4400d5f574d7 - k8s.io/component-base => k8s.io/component-base v0.0.0-20230304000858-ddedd087ad1e + k8s.io/component-base => k8s.io/component-base v0.0.0-20230304000900-3bf8af940f29 k8s.io/component-helpers => k8s.io/component-helpers v0.0.0-20230304001010-94a6fd9a7905 k8s.io/metrics => k8s.io/metrics v0.0.0-20230304005443-556c18548e76 ) diff --git a/go.sum b/go.sum index 9a76a9a5e..3a6c97fb2 100644 --- a/go.sum +++ b/go.sum @@ -533,14 +533,14 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= k8s.io/api v0.0.0-20230303235756-fc1b77c3f4ab h1:peGI8OxM+LOJxG8FqX/y6BVELxehZ4fDq9cm1a5Qaz0= k8s.io/api v0.0.0-20230303235756-fc1b77c3f4ab/go.mod h1:ihVCDKSD6f+H/yGKVpY9HSgpw4StgSvrI3dbK05M9a8= -k8s.io/apimachinery v0.0.0-20230303235433-5b1cff80ea06 h1:d8NkMUaqPq1ghtNIScF2RIPgGhSu+scUUrxsinWDThg= -k8s.io/apimachinery v0.0.0-20230303235433-5b1cff80ea06/go.mod h1:jlJwObMa4oKAEOMnAeEaqeiM+Fwd/CbAwNyQ7OaEwS0= -k8s.io/cli-runtime v0.0.0-20230304005623-a18cae8f8d12 h1:DkWuB43ljW1vn3TdzCNiSkXuMnVIKmk7FhGDYIvhEhs= -k8s.io/cli-runtime v0.0.0-20230304005623-a18cae8f8d12/go.mod h1:MnDsNvMiAsj77VNdmB8sl+ZGymumip5rKXZcmrZsCMc= -k8s.io/client-go v0.0.0-20230304000202-d39f8291fc57 h1:1poxm/0OkMXI+YWheufVMRgXiYBW3Kq2PM+/sHDqvvg= -k8s.io/client-go v0.0.0-20230304000202-d39f8291fc57/go.mod h1:j1Eg/I6nZcgoThl8TATyMIg+1xoKMW0D3JnR2VnBm6c= -k8s.io/component-base v0.0.0-20230304000858-ddedd087ad1e h1:PuygjVw/jQzOBSJ1s6xv1oA7Dc5ZvEDxfpS/5k8ZMHQ= -k8s.io/component-base v0.0.0-20230304000858-ddedd087ad1e/go.mod h1:vldhe13R/1pbgyrY1SwSHHwol4MWZNyU0J5mCvBECfA= +k8s.io/apimachinery v0.0.0-20230303235435-f357b1fa74b7 h1:YN43Lvs3Pj9iQmuWGojeBiFdz1mkrxe0EZn7Ba3TMpQ= +k8s.io/apimachinery v0.0.0-20230303235435-f357b1fa74b7/go.mod h1:jlJwObMa4oKAEOMnAeEaqeiM+Fwd/CbAwNyQ7OaEwS0= +k8s.io/cli-runtime v0.0.0-20230304005626-589dfd9f4f89 h1:bciXN3+NGFObUua20Br9ZtwDK6d7d0eBzbTVYkD0VuY= +k8s.io/cli-runtime v0.0.0-20230304005626-589dfd9f4f89/go.mod h1:e7I39Im546cUQ8NG19UqCv+EBDTmEFFCSTYRim9Puhk= +k8s.io/client-go v0.0.0-20230304000204-06ad6b391d35 h1:9uwNzISbibeQwpbp/a9OFj2Zk98INi4pJfByXGK5nGQ= +k8s.io/client-go v0.0.0-20230304000204-06ad6b391d35/go.mod h1:D9bGnWQ1292GhAR0f2uumanvVdOHddJlD+7OlyUorYM= +k8s.io/component-base v0.0.0-20230304000900-3bf8af940f29 h1:26PuXs5/GsCX5EPltZN9KjZqkW/EwYHaebfNmIK3Wxc= +k8s.io/component-base v0.0.0-20230304000900-3bf8af940f29/go.mod h1:1aFiUfjXiy45a88xJmd/nSkReVCoyShEHbGmWJQbp2Q= k8s.io/component-helpers v0.0.0-20230304001010-94a6fd9a7905 h1:kHWUeYs8Mc9IQpqULpPd2j8G6cqqf/fz5wzvqcYCdSQ= k8s.io/component-helpers v0.0.0-20230304001010-94a6fd9a7905/go.mod h1:IrR1jWfgEwsQ2rBPvbuwL8bmskaLy5lDQ8mIPnPXcbA= k8s.io/klog/v2 v2.90.1 h1:m4bYOKall2MmOiRaR1J+We67Do7vm9KiQVlT96lnHUw= diff --git a/pkg/cmd/debug/debug_test.go b/pkg/cmd/debug/debug_test.go index 7869655b1..08225f8e6 100644 --- a/pkg/cmd/debug/debug_test.go +++ b/pkg/cmd/debug/debug_test.go @@ -448,7 +448,7 @@ func TestGeneratePodCopyWithDebugContainer(t *testing.T) { "test": "test", }, ResourceVersion: "1", - CreationTimestamp: metav1.Time{time.Now()}, + CreationTimestamp: metav1.Time{Time: time.Now()}, }, Spec: corev1.PodSpec{ Containers: []corev1.Container{ diff --git a/pkg/cmd/util/helpers_test.go b/pkg/cmd/util/helpers_test.go index a024f3f34..98ffe8cc7 100644 --- a/pkg/cmd/util/helpers_test.go +++ b/pkg/cmd/util/helpers_test.go @@ -338,7 +338,7 @@ func TestCheckInvalidErr(t *testing.T) { DefaultErrorExitCode, }, { - &errors.StatusError{metav1.Status{ + &errors.StatusError{ErrStatus: metav1.Status{ Status: metav1.StatusFailure, Code: http.StatusUnprocessableEntity, Reason: metav1.StatusReasonInvalid, @@ -349,7 +349,7 @@ func TestCheckInvalidErr(t *testing.T) { }, // invalid error that that includes a message but no details { - &errors.StatusError{metav1.Status{ + &errors.StatusError{ErrStatus: metav1.Status{ Status: metav1.StatusFailure, Code: http.StatusUnprocessableEntity, Reason: metav1.StatusReasonInvalid, @@ -361,7 +361,7 @@ func TestCheckInvalidErr(t *testing.T) { }, // webhook response that sets code=422 with no reason { - &errors.StatusError{metav1.Status{ + &errors.StatusError{ErrStatus: metav1.Status{ Status: "Failure", Message: `admission webhook "my.webhook" denied the request without explanation`, Code: 422, @@ -371,7 +371,7 @@ func TestCheckInvalidErr(t *testing.T) { }, // webhook response that sets code=422 with no reason and non-nil details { - &errors.StatusError{metav1.Status{ + &errors.StatusError{ErrStatus: metav1.Status{ Status: "Failure", Message: `admission webhook "my.webhook" denied the request without explanation`, Code: 422, @@ -382,7 +382,7 @@ func TestCheckInvalidErr(t *testing.T) { }, // source-wrapped webhook response that sets code=422 with no reason { - AddSourceToErr("creating", "configmap.yaml", &errors.StatusError{metav1.Status{ + AddSourceToErr("creating", "configmap.yaml", &errors.StatusError{ErrStatus: metav1.Status{ Status: "Failure", Message: `admission webhook "my.webhook" denied the request without explanation`, Code: 422, @@ -392,7 +392,7 @@ func TestCheckInvalidErr(t *testing.T) { }, // webhook response that sets reason=Invalid and code=422 and a message { - &errors.StatusError{metav1.Status{ + &errors.StatusError{ErrStatus: metav1.Status{ Status: "Failure", Reason: "Invalid", Message: `admission webhook "my.webhook" denied the request without explanation`, diff --git a/pkg/explain/v2/funcs_test.go b/pkg/explain/v2/funcs_test.go index 037d6f5c7..e505ca64f 100644 --- a/pkg/explain/v2/funcs_test.go +++ b/pkg/explain/v2/funcs_test.go @@ -201,11 +201,11 @@ func TestFuncs(t *testing.T) { FuncName: "contains", Source: `{{contains $.haystack $.needle}}`, Context: map[string]any{ - "needle": schema.GroupVersionKind{"testgroup.k8s.io", "v1", "Kind"}, + "needle": schema.GroupVersionKind{Group: "testgroup.k8s.io", Version: "v1", Kind: "Kind"}, "haystack": []schema.GroupVersionKind{ - {"randomgroup.k8s.io", "v1", "OtherKind"}, - {"testgroup.k8s.io", "v1", "OtherKind"}, - {"testgroup.k8s.io", "v1", "Kind"}, + {Group: "randomgroup.k8s.io", Version: "v1", Kind: "OtherKind"}, + {Group: "testgroup.k8s.io", Version: "v1", Kind: "OtherKind"}, + {Group: "testgroup.k8s.io", Version: "v1", Kind: "Kind"}, }, }, Expect: `true`, diff --git a/pkg/polymorphichelpers/history_test.go b/pkg/polymorphichelpers/history_test.go index cb77ecdb7..4f55326d0 100644 --- a/pkg/polymorphichelpers/history_test.go +++ b/pkg/polymorphichelpers/history_test.go @@ -92,7 +92,7 @@ func TestViewDeploymentHistory(t *testing.T) { Namespace: "default", UID: types.UID(fmt.Sprintf("00000000-0000-0000-0000-00000000000%d", i)), Labels: map[string]string{"foo": "bar"}, - OwnerReferences: []metav1.OwnerReference{{"apps/v1", "Deployment", deployment.Name, deployment.UID, &trueVar, nil}}, + OwnerReferences: []metav1.OwnerReference{{APIVersion: "apps/v1", Kind: "Deployment", Name: deployment.Name, UID: deployment.UID, Controller: &trueVar}}, Annotations: map[string]string{ "deployment.kubernetes.io/revision": fmt.Sprintf("%d", i), }, @@ -219,7 +219,7 @@ func TestViewHistory(t *testing.T) { Name: "moons", Namespace: "default", Labels: map[string]string{"foo": "bar"}, - OwnerReferences: []metav1.OwnerReference{{"apps/v1", "StatefulSet", "moons", "1993", &trueVar, nil}}, + OwnerReferences: []metav1.OwnerReference{{APIVersion: "apps/v1", Kind: "StatefulSet", Name: "moons", UID: "1993", Controller: &trueVar}}, }, Data: runtime.RawExtension{Raw: stsRawData}, TypeMeta: metav1.TypeMeta{Kind: "StatefulSet", APIVersion: "apps/v1"}, @@ -323,7 +323,7 @@ func TestViewHistory(t *testing.T) { Name: "moons", Namespace: "default", Labels: map[string]string{"foo": "bar"}, - OwnerReferences: []metav1.OwnerReference{{"apps/v1", "DaemonSet", "moons", "1993", &trueVar, nil}}, + OwnerReferences: []metav1.OwnerReference{{APIVersion: "apps/v1", Kind: "DaemonSet", Name: "moons", UID: "1993", Controller: &trueVar}}, }, Data: runtime.RawExtension{Raw: daemonSetRaw}, TypeMeta: metav1.TypeMeta{Kind: "StatefulSet", APIVersion: "apps/v1"}, diff --git a/pkg/util/i18n/i18n_test.go b/pkg/util/i18n/i18n_test.go index 3098e6db5..57b228165 100644 --- a/pkg/util/i18n/i18n_test.go +++ b/pkg/util/i18n/i18n_test.go @@ -138,6 +138,7 @@ func TestTranslationUsingEnvVar(t *testing.T) { t.Run(test.name, func(t *testing.T) { for _, envVar := range envVarsToBackup { if envVarValue := os.Getenv(envVar); envVarValue != "" { + envVarValue, envVar := envVarValue, envVar os.Unsetenv(envVar) // Restore env var at the end defer func() { os.Setenv(envVar, envVarValue) }()