From 85832ef99c019fde738fb31505fa9e00a00e6ba4 Mon Sep 17 00:00:00 2001 From: Kirill Sibirev Date: Thu, 27 Jun 2024 10:56:34 +0200 Subject: [PATCH] Upd k8s utils (#300) * nolint for "k8s.io/utils/pointer" is deprecated * Upd k8s utils --- api/v1/ytsaurus_webhook.go | 2 +- controllers/remoteexecnodes_test.go | 2 +- go.mod | 2 +- go.sum | 4 ++-- pkg/components/exec_node_base.go | 2 +- pkg/components/microservice.go | 8 +++++--- pkg/components/server.go | 2 +- pkg/components/ytsaurus_client.go | 2 +- pkg/testutil/builders.go | 2 +- pkg/testutil/spec_builders.go | 2 +- pkg/ytconfig/generator.go | 2 +- pkg/ytconfig/node.go | 5 +++-- test/e2e/suite_test.go | 2 +- 13 files changed, 20 insertions(+), 17 deletions(-) diff --git a/api/v1/ytsaurus_webhook.go b/api/v1/ytsaurus_webhook.go index 1fb608bd..55ec569a 100644 --- a/api/v1/ytsaurus_webhook.go +++ b/api/v1/ytsaurus_webhook.go @@ -27,7 +27,7 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/validation/field" "k8s.io/apimachinery/pkg/util/yaml" - ptr "k8s.io/utils/pointer" + ptr "k8s.io/utils/pointer" //nolint:staticcheck ctrl "sigs.k8s.io/controller-runtime" logf "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/webhook" diff --git a/controllers/remoteexecnodes_test.go b/controllers/remoteexecnodes_test.go index 7d7f4d3a..69cffe74 100644 --- a/controllers/remoteexecnodes_test.go +++ b/controllers/remoteexecnodes_test.go @@ -10,7 +10,7 @@ import ( appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - ptr "k8s.io/utils/pointer" + ptr "k8s.io/utils/pointer" //nolint:staticcheck ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/go.mod b/go.mod index 5efd6ddb..5f3551fa 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( k8s.io/api v0.28.3 k8s.io/apimachinery v0.28.3 k8s.io/client-go v0.28.3 - k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 + k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0 sigs.k8s.io/controller-runtime v0.16.5 ) diff --git a/go.sum b/go.sum index 70d27295..3bba2004 100644 --- a/go.sum +++ b/go.sum @@ -273,8 +273,8 @@ k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5OhxCKlKJy0sHc+PcDwFB24dQ= k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9/go.mod h1:wZK2AVp1uHCp4VamDVgBP2COHZjqD1T68Rf0CM3YjSM= -k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 h1:qY1Ad8PODbnymg2pRbkyMT/ylpTrCM8P2RJ0yroCyIk= -k8s.io/utils v0.0.0-20230406110748-d93618cff8a2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0 h1:jgGTlFYnhF1PM1Ax/lAlxUPE+KfCIXHaathvJg1C3ak= +k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= sigs.k8s.io/controller-runtime v0.16.5 h1:yr1cEJbX08xsTW6XEIzT13KHHmIyX8Umvme2cULvFZw= sigs.k8s.io/controller-runtime v0.16.5/go.mod h1:j7bialYoSn142nv9sCOJmQgDXQXxnroFU4VnX/brVJ0= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= diff --git a/pkg/components/exec_node_base.go b/pkg/components/exec_node_base.go index 312a7638..2eba8a86 100644 --- a/pkg/components/exec_node_base.go +++ b/pkg/components/exec_node_base.go @@ -6,7 +6,7 @@ import ( "path" corev1 "k8s.io/api/core/v1" - ptr "k8s.io/utils/pointer" + ptr "k8s.io/utils/pointer" //nolint:staticcheck ytv1 "github.com/ytsaurus/yt-k8s-operator/api/v1" diff --git a/pkg/components/microservice.go b/pkg/components/microservice.go index 02427eb8..3767295f 100644 --- a/pkg/components/microservice.go +++ b/pkg/components/microservice.go @@ -3,15 +3,17 @@ package components import ( "context" + ptr "k8s.io/utils/pointer" //nolint:staticcheck + ytv1 "github.com/ytsaurus/yt-k8s-operator/api/v1" - ptr "k8s.io/utils/pointer" + + appsv1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" "github.com/ytsaurus/yt-k8s-operator/pkg/apiproxy" "github.com/ytsaurus/yt-k8s-operator/pkg/labeller" "github.com/ytsaurus/yt-k8s-operator/pkg/resources" "github.com/ytsaurus/yt-k8s-operator/pkg/ytconfig" - appsv1 "k8s.io/api/apps/v1" - corev1 "k8s.io/api/core/v1" ) // microservice manages common resources of YTsaurus service component diff --git a/pkg/components/server.go b/pkg/components/server.go index 182c9730..1891d833 100644 --- a/pkg/components/server.go +++ b/pkg/components/server.go @@ -6,7 +6,7 @@ import ( "path" "k8s.io/apimachinery/pkg/util/intstr" - ptr "k8s.io/utils/pointer" + ptr "k8s.io/utils/pointer" //nolint:staticcheck appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" diff --git a/pkg/components/ytsaurus_client.go b/pkg/components/ytsaurus_client.go index deb92b45..6d14303b 100644 --- a/pkg/components/ytsaurus_client.go +++ b/pkg/components/ytsaurus_client.go @@ -11,7 +11,7 @@ import ( "go.ytsaurus.tech/yt/go/yt" "go.ytsaurus.tech/yt/go/yt/ythttp" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - ptr "k8s.io/utils/pointer" + ptr "k8s.io/utils/pointer" //nolint:staticcheck ytv1 "github.com/ytsaurus/yt-k8s-operator/api/v1" "github.com/ytsaurus/yt-k8s-operator/pkg/apiproxy" diff --git a/pkg/testutil/builders.go b/pkg/testutil/builders.go index ed2842a4..134a42b6 100644 --- a/pkg/testutil/builders.go +++ b/pkg/testutil/builders.go @@ -3,7 +3,7 @@ package testutil import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - ptr "k8s.io/utils/pointer" + ptr "k8s.io/utils/pointer" //nolint:staticcheck ytv1 "github.com/ytsaurus/yt-k8s-operator/api/v1" "github.com/ytsaurus/yt-k8s-operator/pkg/consts" diff --git a/pkg/testutil/spec_builders.go b/pkg/testutil/spec_builders.go index d3baad4f..999bfcf6 100644 --- a/pkg/testutil/spec_builders.go +++ b/pkg/testutil/spec_builders.go @@ -8,7 +8,7 @@ import ( corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - ptr "k8s.io/utils/pointer" + ptr "k8s.io/utils/pointer" //nolint:staticcheck ytv1 "github.com/ytsaurus/yt-k8s-operator/api/v1" ) diff --git a/pkg/ytconfig/generator.go b/pkg/ytconfig/generator.go index 212dff42..26dcb72e 100644 --- a/pkg/ytconfig/generator.go +++ b/pkg/ytconfig/generator.go @@ -5,7 +5,7 @@ import ( "path" corev1 "k8s.io/api/core/v1" - ptr "k8s.io/utils/pointer" + ptr "k8s.io/utils/pointer" //nolint:staticcheck "go.ytsaurus.tech/yt/go/yson" diff --git a/pkg/ytconfig/node.go b/pkg/ytconfig/node.go index d5061ff3..2a3f121d 100644 --- a/pkg/ytconfig/node.go +++ b/pkg/ytconfig/node.go @@ -8,13 +8,14 @@ import ( "go.ytsaurus.tech/yt/go/yson" - ptr "k8s.io/utils/pointer" + ptr "k8s.io/utils/pointer" //nolint:staticcheck "k8s.io/apimachinery/pkg/api/resource" + corev1 "k8s.io/api/core/v1" + ytv1 "github.com/ytsaurus/yt-k8s-operator/api/v1" "github.com/ytsaurus/yt-k8s-operator/pkg/consts" - corev1 "k8s.io/api/core/v1" ) type NodeFlavor string diff --git a/test/e2e/suite_test.go b/test/e2e/suite_test.go index a7237fcf..1e975bbf 100644 --- a/test/e2e/suite_test.go +++ b/test/e2e/suite_test.go @@ -24,7 +24,7 @@ import ( "testing" "time" - ptr "k8s.io/utils/pointer" + ptr "k8s.io/utils/pointer" //nolint:staticcheck . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega"