From ad4b1189d85df2d7fbef3bf2c0713b0a7358c3ac Mon Sep 17 00:00:00 2001 From: mgianluc Date: Sat, 30 Nov 2024 14:42:51 +0100 Subject: [PATCH] (chore) advance libsveltos and addon-controller pin --- controllers/eventtrigger_deployer.go | 16 +++---- controllers/eventtrigger_deployer_test.go | 21 ++++----- controllers/suite_test.go | 10 ++-- go.mod | 28 ++++++------ go.sum | 56 +++++++++++------------ test/fv/generators_redeploy_test.go | 8 ++-- test/fv/generators_test.go | 8 ++-- 7 files changed, 73 insertions(+), 74 deletions(-) diff --git a/controllers/eventtrigger_deployer.go b/controllers/eventtrigger_deployer.go index 849c746..2fa506f 100644 --- a/controllers/eventtrigger_deployer.go +++ b/controllers/eventtrigger_deployer.go @@ -52,11 +52,11 @@ import ( "github.com/projectsveltos/libsveltos/lib/clusterproxy" "github.com/projectsveltos/libsveltos/lib/deployer" "github.com/projectsveltos/libsveltos/lib/funcmap" + "github.com/projectsveltos/libsveltos/lib/k8s_utils" logs "github.com/projectsveltos/libsveltos/lib/logsettings" libsveltosset "github.com/projectsveltos/libsveltos/lib/set" "github.com/projectsveltos/libsveltos/lib/sharding" libsveltostemplate "github.com/projectsveltos/libsveltos/lib/template" - libsveltosutils "github.com/projectsveltos/libsveltos/lib/utils" ) const ( @@ -685,7 +685,7 @@ func createOrUpdateEventSource(ctx context.Context, remoteClient client.Client, currentEventSource.Annotations = map[string]string{ libsveltosv1beta1.DeployedBySveltosAnnotation: "true", } - deployer.AddOwnerReference(currentEventSource, resource) + k8s_utils.AddOwnerReference(currentEventSource, resource) return remoteClient.Update(ctx, currentEventSource) } @@ -697,7 +697,7 @@ func createOrUpdateEventSource(ctx context.Context, remoteClient client.Client, currentEventSource.Annotations = map[string]string{ libsveltosv1beta1.DeployedBySveltosAnnotation: "true", } - deployer.AddOwnerReference(currentEventSource, resource) + k8s_utils.AddOwnerReference(currentEventSource, resource) logger.V(logs.LogDebug).Info("creating eventSource") return remoteClient.Create(ctx, currentEventSource) @@ -796,7 +796,7 @@ func removeStaleEventSources(ctx context.Context, c client.Client, } l.V(logs.LogDebug).Info("removing OwnerReference") - deployer.RemoveOwnerReference(es, resource) + k8s_utils.RemoveOwnerReference(es, resource) if len(es.GetOwnerReferences()) != 0 { l.V(logs.LogDebug).Info("updating") @@ -968,7 +968,7 @@ func instantiateClusterProfileForResource(ctx context.Context, c client.Client, addTypeInformationToObject(mgmtClusterSchema, clusterProfile) - dr, err := libsveltosutils.GetDynamicResourceInterface(mgmtClusterConfig, + dr, err := k8s_utils.GetDynamicResourceInterface(mgmtClusterConfig, clusterProfile.GetObjectKind().GroupVersionKind(), clusterProfile.GetNamespace()) if err != nil { logger.V(logs.LogInfo).Info(fmt.Sprintf("failed to get dynamic client: %v", err)) @@ -1057,7 +1057,7 @@ func instantiateOneClusterProfilePerAllResource(ctx context.Context, c client.Cl addTypeInformationToObject(mgmtClusterSchema, clusterProfile) - dr, err := libsveltosutils.GetDynamicResourceInterface(mgmtClusterConfig, clusterProfile.GetObjectKind().GroupVersionKind(), clusterProfile.GetNamespace()) + dr, err := k8s_utils.GetDynamicResourceInterface(mgmtClusterConfig, clusterProfile.GetObjectKind().GroupVersionKind(), clusterProfile.GetNamespace()) if err != nil { logger.V(logs.LogInfo).Info(fmt.Sprintf("failed to get dynamic client: %v", err)) return nil, err @@ -1194,7 +1194,7 @@ func getResources(eventReport *libsveltosv1beta1.EventReport, logger logr.Logger var err error var policy *unstructured.Unstructured - policy, err = libsveltosutils.GetUnstructured([]byte(elements[i])) + policy, err = k8s_utils.GetUnstructured([]byte(elements[i])) if err != nil { logger.V(logs.LogInfo).Info(fmt.Sprintf("failed to get policy from Data %.100s", elements[i])) return nil, err @@ -1562,7 +1562,7 @@ func instantiateReferencedPolicy(ctx context.Context, e *v1beta1.EventTrigger, r } addTypeInformationToObject(mgmtClusterSchema, instantiatedObject) - dr, err := libsveltosutils.GetDynamicResourceInterface(mgmtClusterConfig, + dr, err := k8s_utils.GetDynamicResourceInterface(mgmtClusterConfig, instantiatedObject.GetObjectKind().GroupVersionKind(), instantiatedObject.GetNamespace()) if err != nil { logger.V(logs.LogInfo).Info(fmt.Sprintf("failed to get dynamic client: %v", err)) diff --git a/controllers/eventtrigger_deployer_test.go b/controllers/eventtrigger_deployer_test.go index 335446e..1b34f26 100644 --- a/controllers/eventtrigger_deployer_test.go +++ b/controllers/eventtrigger_deployer_test.go @@ -50,9 +50,8 @@ import ( "github.com/projectsveltos/libsveltos/lib/clusterproxy" "github.com/projectsveltos/libsveltos/lib/deployer" fakedeployer "github.com/projectsveltos/libsveltos/lib/deployer/fake" + "github.com/projectsveltos/libsveltos/lib/k8s_utils" libsveltosset "github.com/projectsveltos/libsveltos/lib/set" - "github.com/projectsveltos/libsveltos/lib/utils" - libsveltosutils "github.com/projectsveltos/libsveltos/lib/utils" ) const ( @@ -542,7 +541,7 @@ var _ = Describe("EventTrigger deployer", func() { // Add EventTrigger as owner of EventSource. This indicates previously EventSource was // deployed because of this EventTrigger instance - deployer.AddOwnerReference(eventSource, resource) + k8s_utils.AddOwnerReference(eventSource, resource) Expect(testEnv.Client.Update(context.TODO(), eventSource)).To(Succeed()) // Wait for cache to sync @@ -762,7 +761,7 @@ var _ = Describe("EventTrigger deployer", func() { Expect(waitForObject(context.TODO(), testEnv.Client, staleEventSource)).To(Succeed()) // Add EventTrigger as OwnerReference of the staleEventSource - deployer.AddOwnerReference(staleEventSource, resource) + k8s_utils.AddOwnerReference(staleEventSource, resource) Expect(testEnv.Update(context.TODO(), staleEventSource)).To(Succeed()) eventSource := &libsveltosv1beta1.EventSource{ @@ -812,7 +811,7 @@ var _ = Describe("EventTrigger deployer", func() { nginxName := nginxDeploymentName nginxNamespace := randomString() - u, err := libsveltosutils.GetUnstructured([]byte(fmt.Sprintf(nginxDepl, nginxName, nginxNamespace))) + u, err := k8s_utils.GetUnstructured([]byte(fmt.Sprintf(nginxDepl, nginxName, nginxNamespace))) Expect(err).To(BeNil()) collectedResources := []unstructured.Unstructured{*u} @@ -917,11 +916,11 @@ var _ = Describe("EventTrigger deployer", func() { nginxNamespace1 := randomString() nginxNamespace2 := randomString() - u1, err := libsveltosutils.GetUnstructured([]byte(fmt.Sprintf(nginxDepl, nginxName, nginxNamespace1))) + u1, err := k8s_utils.GetUnstructured([]byte(fmt.Sprintf(nginxDepl, nginxName, nginxNamespace1))) Expect(err).To(BeNil()) var u2 *unstructured.Unstructured - u2, err = libsveltosutils.GetUnstructured([]byte(fmt.Sprintf(nginxDepl, nginxName, nginxNamespace2))) + u2, err = k8s_utils.GetUnstructured([]byte(fmt.Sprintf(nginxDepl, nginxName, nginxNamespace2))) Expect(err).To(BeNil()) collectedResources := []unstructured.Unstructured{*u1, *u2} @@ -1417,11 +1416,11 @@ spec: port: 8443 targetPort: 9379` - u1, err := libsveltosutils.GetUnstructured([]byte(httpsService1)) + u1, err := k8s_utils.GetUnstructured([]byte(httpsService1)) Expect(err).To(BeNil()) var u2 *unstructured.Unstructured - u2, err = libsveltosutils.GetUnstructured([]byte(httpsService2)) + u2, err = k8s_utils.GetUnstructured([]byte(httpsService2)) Expect(err).To(BeNil()) objects := &controllers.CurrentObjects{ @@ -1626,7 +1625,7 @@ spec: port: 80 targetPort: 9376` - u, err := libsveltosutils.GetUnstructured([]byte(service)) + u, err := k8s_utils.GetUnstructured([]byte(service)) Expect(err).To(BeNil()) Expect(u).ToNot(BeNil()) @@ -1656,7 +1655,7 @@ spec: if elements[i] == "" { continue } - policy, err := utils.GetUnstructured([]byte(elements[i])) + policy, err := k8s_utils.GetUnstructured([]byte(elements[i])) Expect(err).To(BeNil()) Expect(policy).ToNot(BeNil()) diff --git a/controllers/suite_test.go b/controllers/suite_test.go index d6eccfe..963478b 100644 --- a/controllers/suite_test.go +++ b/controllers/suite_test.go @@ -36,7 +36,7 @@ import ( "github.com/projectsveltos/event-manager/controllers" "github.com/projectsveltos/event-manager/internal/test/helpers" libsveltoscrd "github.com/projectsveltos/libsveltos/lib/crd" - "github.com/projectsveltos/libsveltos/lib/utils" + "github.com/projectsveltos/libsveltos/lib/k8s_utils" ) var ( @@ -84,25 +84,25 @@ var _ = BeforeSuite(func() { }() var sveltosCRD *unstructured.Unstructured - sveltosCRD, err = utils.GetUnstructured(libsveltoscrd.GetSveltosClusterCRDYAML()) + sveltosCRD, err = k8s_utils.GetUnstructured(libsveltoscrd.GetSveltosClusterCRDYAML()) Expect(err).To(BeNil()) Expect(testEnv.Create(context.TODO(), sveltosCRD)).To(Succeed()) Expect(waitForObject(context.TODO(), testEnv, sveltosCRD)).To(Succeed()) var eventSourceCRD *unstructured.Unstructured - eventSourceCRD, err = utils.GetUnstructured(libsveltoscrd.GetEventSourceCRDYAML()) + eventSourceCRD, err = k8s_utils.GetUnstructured(libsveltoscrd.GetEventSourceCRDYAML()) Expect(err).To(BeNil()) Expect(testEnv.Create(context.TODO(), eventSourceCRD)).To(Succeed()) Expect(waitForObject(context.TODO(), testEnv, eventSourceCRD)).To(Succeed()) var eventReportCRD *unstructured.Unstructured - eventReportCRD, err = utils.GetUnstructured(libsveltoscrd.GetEventReportCRDYAML()) + eventReportCRD, err = k8s_utils.GetUnstructured(libsveltoscrd.GetEventReportCRDYAML()) Expect(err).To(BeNil()) Expect(testEnv.Create(context.TODO(), eventReportCRD)).To(Succeed()) Expect(waitForObject(context.TODO(), testEnv, eventReportCRD)).To(Succeed()) var dcCRD *unstructured.Unstructured - dcCRD, err = utils.GetUnstructured(libsveltoscrd.GetDebuggingConfigurationCRDYAML()) + dcCRD, err = k8s_utils.GetUnstructured(libsveltoscrd.GetDebuggingConfigurationCRDYAML()) Expect(err).To(BeNil()) Expect(testEnv.Create(context.TODO(), dcCRD)).To(Succeed()) Expect(waitForObject(context.TODO(), testEnv, dcCRD)).To(Succeed()) diff --git a/go.mod b/go.mod index d84f019..4dbb82d 100644 --- a/go.mod +++ b/go.mod @@ -7,30 +7,31 @@ require ( github.com/gdexlab/go-render v1.0.1 github.com/go-logr/logr v1.4.2 github.com/google/gofuzz v1.2.0 - github.com/onsi/ginkgo/v2 v2.21.0 - github.com/onsi/gomega v1.35.1 + github.com/onsi/ginkgo/v2 v2.22.0 + github.com/onsi/gomega v1.36.0 github.com/pkg/errors v0.9.1 - github.com/projectsveltos/addon-controller v0.42.0 - github.com/projectsveltos/libsveltos v0.42.0 + github.com/projectsveltos/addon-controller v0.38.1-0.20241129172959-b3b0e958d624 + github.com/projectsveltos/libsveltos v0.42.1-0.20241129122707-e7c51baedfbd github.com/prometheus/client_golang v1.20.5 github.com/spf13/pflag v1.0.5 golang.org/x/text v0.20.0 - k8s.io/api v0.31.2 - k8s.io/apiextensions-apiserver v0.31.2 - k8s.io/apimachinery v0.31.2 - k8s.io/client-go v0.31.2 - k8s.io/component-base v0.31.2 + gopkg.in/yaml.v2 v2.4.0 + k8s.io/api v0.31.3 + k8s.io/apiextensions-apiserver v0.31.3 + k8s.io/apimachinery v0.31.3 + k8s.io/client-go v0.31.3 + k8s.io/component-base v0.31.3 k8s.io/klog/v2 v2.130.1 k8s.io/utils v0.0.0-20241104163129-6fe5fd82f078 sigs.k8s.io/cluster-api v1.8.5 - sigs.k8s.io/controller-runtime v0.19.1 + sigs.k8s.io/controller-runtime v0.19.2 ) require ( dario.cat/mergo v1.0.1 // indirect github.com/BurntSushi/toml v1.4.0 // indirect github.com/Masterminds/goutils v1.1.1 // indirect - github.com/Masterminds/semver/v3 v3.3.0 // indirect + github.com/Masterminds/semver/v3 v3.3.1 // indirect github.com/Masterminds/sprig/v3 v3.3.0 // indirect github.com/antlr4-go/antlr/v4 v4.13.1 // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect @@ -103,12 +104,11 @@ require ( google.golang.org/protobuf v1.35.1 // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/apiserver v0.31.2 // indirect + k8s.io/apiserver v0.31.3 // indirect k8s.io/cluster-bootstrap v0.31.1 // indirect k8s.io/kube-openapi v0.0.0-20241009091222-67ed5848f094 // indirect - k8s.io/kubectl v0.31.2 // indirect + k8s.io/kubectl v0.31.3 // indirect sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect diff --git a/go.sum b/go.sum index a5c3122..8682185 100644 --- a/go.sum +++ b/go.sum @@ -6,8 +6,8 @@ github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver/v3 v3.3.0 h1:B8LGeaivUe71a5qox1ICM/JLl0NqZSW5CHyL+hmvYS0= -github.com/Masterminds/semver/v3 v3.3.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= +github.com/Masterminds/semver/v3 v3.3.1 h1:QtNSWtVZ3nBfk8mAOu/B6v7FMJ+NHTIgUPi7rj+4nv4= +github.com/Masterminds/semver/v3 v3.3.1/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= github.com/Masterminds/sprig/v3 v3.3.0 h1:mQh0Yrg1XPo6vjYXgtf5OtijNAKJRNcTdOOGZe3tPhs= github.com/Masterminds/sprig/v3 v3.3.0/go.mod h1:Zy1iXRYNqNLUolqCpL4uhk6SHUMAOSCzdgBfDb35Lz0= github.com/TwiN/go-color v1.4.1 h1:mqG0P/KBgHKVqmtL5ye7K0/Gr4l6hTksPgTgMk3mUzc= @@ -123,21 +123,21 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/onsi/ginkgo/v2 v2.21.0 h1:7rg/4f3rB88pb5obDgNZrNHrQ4e6WpjonchcpuBRnZM= -github.com/onsi/ginkgo/v2 v2.21.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo= -github.com/onsi/gomega v1.35.1 h1:Cwbd75ZBPxFSuZ6T+rN/WCb/gOc6YgFBXLlZLhC7Ds4= -github.com/onsi/gomega v1.35.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog= -github.com/opencontainers/go-digest v1.0.1-0.20220411205349-bde1400a84be h1:f2PlhC9pm5sqpBZFvnAoKj+KzXRzbjFMA+TqXfJdgho= -github.com/opencontainers/go-digest v1.0.1-0.20220411205349-bde1400a84be/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= +github.com/onsi/ginkgo/v2 v2.22.0 h1:Yed107/8DjTr0lKCNt7Dn8yQ6ybuDRQoMGrNFKzMfHg= +github.com/onsi/ginkgo/v2 v2.22.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo= +github.com/onsi/gomega v1.36.0 h1:Pb12RlruUtj4XUuPUqeEWc6j5DkVVVA49Uf6YLfC95Y= +github.com/onsi/gomega v1.36.0/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog= +github.com/opencontainers/go-digest v1.0.1-0.20240426182413-22b78e47854a h1:JgnDqvmVl/kOyC4pEpn2Ra2QtisfpG27Hp+xFKF26AE= +github.com/opencontainers/go-digest v1.0.1-0.20240426182413-22b78e47854a/go.mod h1:RqnyioA3pIEZMkSbOIcrw32YSgETfn/VrLuEikEdPNU= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/projectsveltos/addon-controller v0.42.0 h1:omVSsxFEwjubtRcq8TYRGzpZPo1MGcsrk818WUcusKY= -github.com/projectsveltos/addon-controller v0.42.0/go.mod h1:zFbm1vOgqWclKbhHml5EslUh0wntqIEGRdYtg6kar2E= -github.com/projectsveltos/libsveltos v0.42.0 h1:U+mFYi2K4IPY1rvpg4jAPBqG4PaznUK4huo/xnFk7jc= -github.com/projectsveltos/libsveltos v0.42.0/go.mod h1:DvifWRZuPtGKi4oGzQzcGe8XBKlzIlx2DcaoukAio+M= +github.com/projectsveltos/addon-controller v0.38.1-0.20241129172959-b3b0e958d624 h1:ljNcE2S0GdGYmH3zDBtsJa7nMYbvqZQukJmWkQTkebQ= +github.com/projectsveltos/addon-controller v0.38.1-0.20241129172959-b3b0e958d624/go.mod h1:WB/ean/I1EqRG9Mfw6+Jq371y1ykrF8Jetsh4lnKXMc= +github.com/projectsveltos/libsveltos v0.42.1-0.20241129122707-e7c51baedfbd h1:csSkEGSZS8DJ+EioxTdJDC+dDcyvVWzWo8yaWlgBOoc= +github.com/projectsveltos/libsveltos v0.42.1-0.20241129122707-e7c51baedfbd/go.mod h1:4hqQRjwZ/DZ6u0haL3zhdARZ3lpspLv57rkhpXIzbsg= github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= @@ -262,34 +262,34 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.31.2 h1:3wLBbL5Uom/8Zy98GRPXpJ254nEFpl+hwndmk9RwmL0= -k8s.io/api v0.31.2/go.mod h1:bWmGvrGPssSK1ljmLzd3pwCQ9MgoTsRCuK35u6SygUk= -k8s.io/apiextensions-apiserver v0.31.2 h1:W8EwUb8+WXBLu56ser5IudT2cOho0gAKeTOnywBLxd0= -k8s.io/apiextensions-apiserver v0.31.2/go.mod h1:i+Geh+nGCJEGiCGR3MlBDkS7koHIIKWVfWeRFiOsUcM= -k8s.io/apimachinery v0.31.2 h1:i4vUt2hPK56W6mlT7Ry+AO8eEsyxMD1U44NR22CLTYw= -k8s.io/apimachinery v0.31.2/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= -k8s.io/apiserver v0.31.2 h1:VUzOEUGRCDi6kX1OyQ801m4A7AUPglpsmGvdsekmcI4= -k8s.io/apiserver v0.31.2/go.mod h1:o3nKZR7lPlJqkU5I3Ove+Zx3JuoFjQobGX1Gctw6XuE= -k8s.io/client-go v0.31.2 h1:Y2F4dxU5d3AQj+ybwSMqQnpZH9F30//1ObxOKlTI9yc= -k8s.io/client-go v0.31.2/go.mod h1:NPa74jSVR/+eez2dFsEIHNa+3o09vtNaWwWwb1qSxSs= +k8s.io/api v0.31.3 h1:umzm5o8lFbdN/hIXbrK9oRpOproJO62CV1zqxXrLgk8= +k8s.io/api v0.31.3/go.mod h1:UJrkIp9pnMOI9K2nlL6vwpxRzzEX5sWgn8kGQe92kCE= +k8s.io/apiextensions-apiserver v0.31.3 h1:+GFGj2qFiU7rGCsA5o+p/rul1OQIq6oYpQw4+u+nciE= +k8s.io/apiextensions-apiserver v0.31.3/go.mod h1:2DSpFhUZZJmn/cr/RweH1cEVVbzFw9YBu4T+U3mf1e4= +k8s.io/apimachinery v0.31.3 h1:6l0WhcYgasZ/wk9ktLq5vLaoXJJr5ts6lkaQzgeYPq4= +k8s.io/apimachinery v0.31.3/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +k8s.io/apiserver v0.31.3 h1:+1oHTtCB+OheqFEz375D0IlzHZ5VeQKX1KGXnx+TTuY= +k8s.io/apiserver v0.31.3/go.mod h1:PrxVbebxrxQPFhJk4powDISIROkNMKHibTg9lTRQ0Qg= +k8s.io/client-go v0.31.3 h1:CAlZuM+PH2cm+86LOBemaJI/lQ5linJ6UFxKX/SoG+4= +k8s.io/client-go v0.31.3/go.mod h1:2CgjPUTpv3fE5dNygAr2NcM8nhHzXvxB8KL5gYc3kJs= k8s.io/cluster-bootstrap v0.31.1 h1:lS5aJi2r6WEKnjO5UhbYsz8e3xmEfoF4Hiob/gnB/Nk= k8s.io/cluster-bootstrap v0.31.1/go.mod h1:dxroRr4eQ0ekxis/kzGa1qODprQXAxQZrgDLfTk8Pug= -k8s.io/component-base v0.31.2 h1:Z1J1LIaC0AV+nzcPRFqfK09af6bZ4D1nAOpWsy9owlA= -k8s.io/component-base v0.31.2/go.mod h1:9PeyyFN/drHjtJZMCTkSpQJS3U9OXORnHQqMLDz0sUQ= +k8s.io/component-base v0.31.3 h1:DMCXXVx546Rfvhj+3cOm2EUxhS+EyztH423j+8sOwhQ= +k8s.io/component-base v0.31.3/go.mod h1:xME6BHfUOafRgT0rGVBGl7TuSg8Z9/deT7qq6w7qjIU= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20241009091222-67ed5848f094 h1:MErs8YA0abvOqJ8gIupA1Tz6PKXYUw34XsGlA7uSL1k= k8s.io/kube-openapi v0.0.0-20241009091222-67ed5848f094/go.mod h1:7ioBJr1A6igWjsR2fxq2EZ0mlMwYLejazSIc2bzMp2U= -k8s.io/kubectl v0.31.2 h1:gTxbvRkMBwvTSAlobiTVqsH6S8Aa1aGyBcu5xYLsn8M= -k8s.io/kubectl v0.31.2/go.mod h1:EyASYVU6PY+032RrTh5ahtSOMgoDRIux9V1JLKtG5xM= +k8s.io/kubectl v0.31.3 h1:3r111pCjPsvnR98oLLxDMwAeM6OPGmPty6gSKaLTQes= +k8s.io/kubectl v0.31.3/go.mod h1:lhMECDCbJN8He12qcKqs2QfmVo9Pue30geovBVpH5fs= k8s.io/utils v0.0.0-20241104163129-6fe5fd82f078 h1:jGnCPejIetjiy2gqaJ5V0NLwTpF4wbQ6cZIItJCSHno= k8s.io/utils v0.0.0-20241104163129-6fe5fd82f078/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 h1:2770sDpzrjjsAtVhSeUFseziht227YAWYHLGNM8QPwY= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw= sigs.k8s.io/cluster-api v1.8.5 h1:lNA2fPN4fkXEs+oOQlnwxT/4VwRFBpv5kkSoJG8nqBA= sigs.k8s.io/cluster-api v1.8.5/go.mod h1:pXv5LqLxuIbhGIXykyNKiJh+KrLweSBajVHHitPLyoY= -sigs.k8s.io/controller-runtime v0.19.1 h1:Son+Q40+Be3QWb+niBXAg2vFiYWolDjjRfO8hn/cxOk= -sigs.k8s.io/controller-runtime v0.19.1/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4= +sigs.k8s.io/controller-runtime v0.19.2 h1:3sPrF58XQEPzbE8T81TN6selQIMGbtYwuaJ6eDssDF8= +sigs.k8s.io/controller-runtime v0.19.2/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= diff --git a/test/fv/generators_redeploy_test.go b/test/fv/generators_redeploy_test.go index 749983a..755fc84 100644 --- a/test/fv/generators_redeploy_test.go +++ b/test/fv/generators_redeploy_test.go @@ -33,7 +33,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "github.com/projectsveltos/event-manager/api/v1beta1" - "github.com/projectsveltos/libsveltos/lib/utils" + "github.com/projectsveltos/libsveltos/lib/k8s_utils" ) const ( @@ -163,7 +163,7 @@ data: // This is the Secret that gets copied over to managed cluster By("Create regcred Secret") - regcred, err := utils.GetUnstructured([]byte(regcredSecret)) + regcred, err := k8s_utils.GetUnstructured([]byte(regcredSecret)) Expect(err).To(BeNil()) err = k8sClient.Create(context.TODO(), regcred) if err != nil { @@ -179,7 +179,7 @@ data: objects, err := customSplit(configuration) Expect(err).To(BeNil()) for i := range objects { - o, err := utils.GetUnstructured([]byte(objects[i])) + o, err := k8s_utils.GetUnstructured([]byte(objects[i])) Expect(err).To(BeNil()) err = k8sClient.Create(context.TODO(), o) if err != nil { @@ -219,7 +219,7 @@ data: Expect(k8sClient.Get(context.TODO(), types.NamespacedName{Namespace: "default", Name: configMapGeneratorName}, currentConfigMap)).To(Succeed()) - newConfigMap, err := utils.GetUnstructured([]byte(fmt.Sprintf(newConfigMapString, configMapGeneratorName))) + newConfigMap, err := k8s_utils.GetUnstructured([]byte(fmt.Sprintf(newConfigMapString, configMapGeneratorName))) Expect(err).To(BeNil()) newConfigMap.SetResourceVersion(currentConfigMap.ResourceVersion) Expect(k8sClient.Update(context.TODO(), newConfigMap)) diff --git a/test/fv/generators_test.go b/test/fv/generators_test.go index c944774..87da1af 100644 --- a/test/fv/generators_test.go +++ b/test/fv/generators_test.go @@ -31,7 +31,7 @@ import ( configv1beta1 "github.com/projectsveltos/addon-controller/api/v1beta1" "github.com/projectsveltos/event-manager/api/v1beta1" libsveltosv1beta1 "github.com/projectsveltos/libsveltos/api/v1beta1" - libsveltosutils "github.com/projectsveltos/libsveltos/lib/utils" + "github.com/projectsveltos/libsveltos/lib/k8s_utils" ) var ( @@ -104,7 +104,7 @@ var _ = Describe("Generators", func() { } Expect(k8sClient.Create(context.TODO(), &eventSource)).To(Succeed()) - u, err := libsveltosutils.GetUnstructured([]byte(toDeployConfigMap)) + u, err := k8s_utils.GetUnstructured([]byte(toDeployConfigMap)) Expect(err).To(BeNil()) Byf("Creating a ConfigMap %s/%s to be referenced in PolicyRefs section", u.GetNamespace(), u.GetName()) @@ -124,7 +124,7 @@ var _ = Describe("Generators", func() { map[string]string{key: value}, []configv1beta1.PolicyRef{policyRef}) eventTrigger.Spec.OneForEvent = true - u, err = libsveltosutils.GetUnstructured([]byte(tokenConfigMap)) + u, err = k8s_utils.GetUnstructured([]byte(tokenConfigMap)) Expect(err).To(BeNil()) err = k8sClient.Create(context.TODO(), u) if err != nil { @@ -347,7 +347,7 @@ func createNamespaceAndSecret(c client.Client, secretNamespace string) { } func deleteConfigMap(cm string) { - u, err := libsveltosutils.GetUnstructured([]byte(cm)) + u, err := k8s_utils.GetUnstructured([]byte(cm)) Expect(err).To(BeNil()) currentConfigMap := &corev1.ConfigMap{}