From c4acd5f272ed5120ea5636bd762d58a10c3fa656 Mon Sep 17 00:00:00 2001 From: Tom Pantelis Date: Thu, 16 Nov 2023 18:18:41 -0500 Subject: [PATCH] Bump admiral and adjust to changes Signed-off-by: Tom Pantelis --- go.mod | 2 +- go.sum | 4 ++-- pkg/agent/controller/clusterip_service_test.go | 3 +-- pkg/agent/controller/service_import.go | 5 +++-- pkg/agent/controller/service_import_aggregator.go | 5 +++-- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 2dbe15603..392332285 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/onsi/gomega v1.29.0 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.17.0 - github.com/submariner-io/admiral v0.17.0-m0 + github.com/submariner-io/admiral v0.17.0-m0.0.20231120132452-d48504c13984 github.com/submariner-io/shipyard v0.17.0-m0 github.com/uw-labs/lichen v0.1.7 k8s.io/api v0.28.3 diff --git a/go.sum b/go.sum index ac5af409c..76319f6da 100644 --- a/go.sum +++ b/go.sum @@ -405,8 +405,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= -github.com/submariner-io/admiral v0.17.0-m0 h1:izqMJGUkvetbl0gmJqn9JOqEix9m/cqs1z5U43x7q+4= -github.com/submariner-io/admiral v0.17.0-m0/go.mod h1:LlsHkfjC9elvCMoII7WGL0aXt1pE2L1s78DGzO3XNYM= +github.com/submariner-io/admiral v0.17.0-m0.0.20231120132452-d48504c13984 h1:PZ+aI8O9v4tWwHvCibM8BmgSMcmUJ1pVXOOWsM9BEws= +github.com/submariner-io/admiral v0.17.0-m0.0.20231120132452-d48504c13984/go.mod h1:LlsHkfjC9elvCMoII7WGL0aXt1pE2L1s78DGzO3XNYM= github.com/submariner-io/shipyard v0.17.0-m0 h1:av6VVjcBnc91QM57G4OaMOf6QzPuZjfCzSzd09zp4LE= github.com/submariner-io/shipyard v0.17.0-m0/go.mod h1:QukrJrSIcTkdn5V2JogLHtaoLXTmrsyE9dEu/FBMXRs= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= diff --git a/pkg/agent/controller/clusterip_service_test.go b/pkg/agent/controller/clusterip_service_test.go index c076b5247..8e29d4934 100644 --- a/pkg/agent/controller/clusterip_service_test.go +++ b/pkg/agent/controller/clusterip_service_test.go @@ -30,7 +30,6 @@ import ( corev1 "k8s.io/api/core/v1" discovery "k8s.io/api/discovery/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" "k8s.io/utils/ptr" mcsv1a1 "sigs.k8s.io/mcs-api/pkg/apis/v1alpha1" ) @@ -285,7 +284,7 @@ func testClusterIPServiceInOneCluster() { Labels: map[string]string{discovery.LabelManagedBy: "other"}, }}) - testutil.EnsureNoResource[runtime.Object](resource.ForDynamic(endpointSliceClientFor(t.syncerConfig.BrokerClient, + testutil.EnsureNoResource(resource.ForDynamic(endpointSliceClientFor(t.syncerConfig.BrokerClient, test.RemoteNamespace)), "other-eps") }) diff --git a/pkg/agent/controller/service_import.go b/pkg/agent/controller/service_import.go index 4a5273ceb..4669b5818 100644 --- a/pkg/agent/controller/service_import.go +++ b/pkg/agent/controller/service_import.go @@ -35,6 +35,7 @@ import ( "github.com/submariner-io/lighthouse/pkg/constants" 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/runtime" "k8s.io/client-go/dynamic" "k8s.io/client-go/tools/cache" @@ -309,10 +310,10 @@ func (c *ServiceImportController) Distribute(ctx context.Context, obj runtime.Ob // is determined from the constituent clusters' EndpointSlices, thus each cluster must have a consistent view of all // the EndpointSlices in order for the aggregated port information to be eventually consistent. - result, err := util.CreateOrUpdate[runtime.Object](ctx, + result, err := util.CreateOrUpdate(ctx, resource.ForDynamic(c.serviceImportAggregator.brokerServiceImportClient()), c.converter.toUnstructured(aggregate), - func(obj runtime.Object) (runtime.Object, error) { + func(obj *unstructured.Unstructured) (*unstructured.Unstructured, error) { existing := c.converter.toServiceImport(obj) if localServiceImport.Spec.Type != existing.Spec.Type { diff --git a/pkg/agent/controller/service_import_aggregator.go b/pkg/agent/controller/service_import_aggregator.go index dd2b6381b..385d438f0 100644 --- a/pkg/agent/controller/service_import_aggregator.go +++ b/pkg/agent/controller/service_import_aggregator.go @@ -31,6 +31,7 @@ import ( discovery "k8s.io/api/discovery/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/dynamic" @@ -121,9 +122,9 @@ func (a *ServiceImportAggregator) update(ctx context.Context, name, namespace st }, } - return util.Update[runtime.Object](ctx, resource.ForDynamic(a.brokerServiceImportClient()), + return util.Update(ctx, resource.ForDynamic(a.brokerServiceImportClient()), a.converter.toUnstructured(aggregate), - func(obj runtime.Object) (runtime.Object, error) { + func(obj *unstructured.Unstructured) (*unstructured.Unstructured, error) { existing := a.converter.toServiceImport(obj) err := mutate(existing)