Skip to content

Commit

Permalink
Bump admiral and adjust to changes
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Pantelis <[email protected]>
  • Loading branch information
tpantelis committed Nov 22, 2023
1 parent ae32051 commit 17bf0f5
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
3 changes: 1 addition & 2 deletions pkg/agent/controller/clusterip_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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")
})

Expand Down
5 changes: 3 additions & 2 deletions pkg/agent/controller/service_import.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 {
Expand Down
6 changes: 4 additions & 2 deletions pkg/agent/controller/service_import_aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -121,9 +122,10 @@ func (a *ServiceImportAggregator) update(ctx context.Context, name, namespace st
},
}

return util.Update[runtime.Object](ctx, resource.ForDynamic(a.brokerServiceImportClient()),
//nolint:wrapcheck // Let the caller wrap it
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)
Expand Down

0 comments on commit 17bf0f5

Please sign in to comment.