Skip to content

Commit

Permalink
build(deps): bump sigs.k8s.io/controller-runtime from 0.15.1 to 0.16.2
Browse files Browse the repository at this point in the history
Bumps [sigs.k8s.io/controller-runtime](https://github.com/kubernetes-sigs/controller-runtime) from 0.15.1 to 0.16.2.
- [Release notes](https://github.com/kubernetes-sigs/controller-runtime/releases)
- [Changelog](https://github.com/kubernetes-sigs/controller-runtime/blob/main/RELEASE.md)
- [Commits](kubernetes-sigs/controller-runtime@v0.15.1...v0.16.2)

---
updated-dependencies:
- dependency-name: sigs.k8s.io/controller-runtime
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
  • Loading branch information
dependabot[bot] authored and aleoli committed Oct 13, 2023
1 parent 9dd9602 commit 3b52571
Show file tree
Hide file tree
Showing 14 changed files with 92 additions and 65 deletions.
1 change: 0 additions & 1 deletion cmd/crd-replicator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ func main() {
mgr, err := ctrl.NewManager(cfg, ctrl.Options{
MapperProvider: mapper.LiqoMapperProvider(scheme),
Scheme: scheme,
Port: 9443,
LeaderElection: false,
})
if err != nil {
Expand Down
16 changes: 12 additions & 4 deletions cmd/discovery/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ import (
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
"k8s.io/klog/v2"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/metrics/server"

discoveryv1alpha1 "github.com/liqotech/liqo/apis/discovery/v1alpha1"
nettypes "github.com/liqotech/liqo/apis/net/v1alpha1"
Expand Down Expand Up @@ -96,10 +98,16 @@ func main() {
// Create an accessory manager restricted to the given namespace only, to avoid introducing
// performance overhead and requiring excessively wide permissions when not necessary.
auxmgr, err := ctrl.NewManager(config, ctrl.Options{
MapperProvider: mapper.LiqoMapperProvider(scheme),
Scheme: scheme,
Namespace: *namespace,
MetricsBindAddress: "0", // Disable the metrics of the auxiliary manager to prevent conflicts.
MapperProvider: mapper.LiqoMapperProvider(scheme),
Scheme: scheme,
Metrics: server.Options{
BindAddress: "0", // Disable the metrics of the auxiliary manager to prevent conflicts.
},
Cache: cache.Options{
DefaultNamespaces: map[string]cache.Config{
*namespace: {},
},
},
})
if err != nil {
klog.Errorf("Unable to create auxiliary (namespaced) manager: %w", err)
Expand Down
27 changes: 17 additions & 10 deletions cmd/liqo-controller-manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/manager"
"sigs.k8s.io/controller-runtime/pkg/metrics/server"
"sigs.k8s.io/controller-runtime/pkg/webhook"
"sigs.k8s.io/sig-storage-lib-external-provisioner/v7/controller"

Expand Down Expand Up @@ -230,16 +231,22 @@ func main() {
// Create the main manager.
// This manager caches only the pods that are offloaded from a remote cluster and are scheduled on this.
mgr, err := ctrl.NewManager(config, ctrl.Options{
MapperProvider: mapper.LiqoMapperProvider(scheme),
Scheme: scheme,
MetricsBindAddress: *metricsAddr,
MapperProvider: mapper.LiqoMapperProvider(scheme),
Scheme: scheme,
Metrics: server.Options{
BindAddress: *metricsAddr,
},
HealthProbeBindAddress: *probeAddr,
LeaderElection: *leaderElection,
LeaderElectionID: "66cf253f.ctrlmgr.liqo.io",
LeaderElectionNamespace: *liqoNamespace,
LeaderElectionReleaseOnCancel: true,
LeaderElectionResourceLock: resourcelock.LeasesResourceLock,
Port: int(*webhookPort),
WebhookServer: &webhook.DefaultServer{
Options: webhook.Options{
Port: int(*webhookPort),
},
},
NewCache: func(config *rest.Config, opts cache.Options) (cache.Cache, error) {
opts.ByObject = map[client.Object]cache.ByObject{
&corev1.Pod{}: {
Expand All @@ -261,9 +268,9 @@ func main() {
// Create an accessory manager that cache only local offloaded pods.
// This manager caches only the pods that are offloaded and scheduled on a remote cluster.
auxmgrLocalPods, err := ctrl.NewManager(config, ctrl.Options{
MapperProvider: mapper.LiqoMapperProvider(scheme),
Scheme: scheme,
MetricsBindAddress: "0", // Disable the metrics of the auxiliary manager to prevent conflicts.
MapperProvider: mapper.LiqoMapperProvider(scheme),
Scheme: scheme,
Metrics: server.Options{BindAddress: "0"}, // Disable the metrics of the auxiliary manager to prevent conflicts.
NewCache: func(config *rest.Config, opts cache.Options) (cache.Cache, error) {
opts.ByObject = map[client.Object]cache.ByObject{
&corev1.Pod{}: {
Expand All @@ -287,9 +294,9 @@ func main() {
// Create an accessory manager that cache only local offloaded pods.
// This manager caches only virtual kubelet pods.
auxmgrVirtualKubeletPods, err := ctrl.NewManager(config, ctrl.Options{
MapperProvider: mapper.LiqoMapperProvider(scheme),
Scheme: scheme,
MetricsBindAddress: "0", // Disable the metrics of the auxiliary manager to prevent conflicts.
MapperProvider: mapper.LiqoMapperProvider(scheme),
Scheme: scheme,
Metrics: server.Options{BindAddress: "0"}, // Disable the metrics of the auxiliary manager to prevent conflicts.
NewCache: func(config *rest.Config, opts cache.Options) (cache.Cache, error) {
opts.ByObject = map[client.Object]cache.ByObject{
&corev1.Pod{}: {
Expand Down
15 changes: 9 additions & 6 deletions cmd/liqonet/gateway-operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/metrics/server"

tunneloperator "github.com/liqotech/liqo/internal/liqonet/tunnel-operator"
liqoconst "github.com/liqotech/liqo/pkg/consts"
Expand Down Expand Up @@ -117,9 +118,11 @@ func runGatewayOperator(commonFlags *liqonetCommonFlags, gatewayFlags *gatewayOp
config := restcfg.SetRateLimiter(ctrl.GetConfigOrDie())

main, err := ctrl.NewManager(config, ctrl.Options{
MapperProvider: mapper.LiqoMapperProvider(scheme),
Scheme: scheme,
MetricsBindAddress: metricsAddr,
MapperProvider: mapper.LiqoMapperProvider(scheme),
Scheme: scheme,
Metrics: server.Options{
BindAddress: metricsAddr,
},
LeaderElection: enableLeaderElection,
LeaderElectionID: liqoconst.GatewayLeaderElectionID,
LeaderElectionNamespace: podNamespace,
Expand Down Expand Up @@ -149,9 +152,9 @@ func runGatewayOperator(commonFlags *liqonetCommonFlags, gatewayFlags *gatewayOp
// Create an accessory manager that cache only pods managed by a ShadowPod (i.e., remote offloaded pods).
// This manager caches only the pods that are offloaded from a remote cluster and are scheduled on this.
auxmgrOffloadedPods, err := ctrl.NewManager(config, ctrl.Options{
MapperProvider: mapper.LiqoMapperProvider(scheme),
Scheme: scheme,
MetricsBindAddress: "0", // Disable the metrics of the auxiliary manager to prevent conflicts.
MapperProvider: mapper.LiqoMapperProvider(scheme),
Scheme: scheme,
Metrics: server.Options{BindAddress: "0"}, // Disable the metrics of the auxiliary manager to prevent conflicts.
NewCache: func(config *rest.Config, opts cache.Options) (cache.Cache, error) {
opts.ByObject = map[client.Object]cache.ByObject{
&corev1.Pod{}: {
Expand Down
9 changes: 6 additions & 3 deletions cmd/liqonet/network-manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/metrics/server"

"github.com/liqotech/liqo/internal/liqonet/network-manager/netcfgcreator"
"github.com/liqotech/liqo/internal/liqonet/network-manager/tunnelendpointcreator"
Expand Down Expand Up @@ -62,9 +63,11 @@ func runNetworkManager(commonFlags *liqonetCommonFlags, managerFlags *networkMan
}

mgr, err := ctrl.NewManager(restcfg.SetRateLimiter(ctrl.GetConfigOrDie()), ctrl.Options{
MapperProvider: mapper.LiqoMapperProvider(scheme),
Scheme: scheme,
MetricsBindAddress: commonFlags.metricsAddr,
MapperProvider: mapper.LiqoMapperProvider(scheme),
Scheme: scheme,
Metrics: server.Options{
BindAddress: commonFlags.metricsAddr,
},
NewCache: func(config *rest.Config, opts cache.Options) (cache.Cache, error) {
opts.ByObject = map[client.Object]cache.ByObject{
&corev1.Secret{}: {
Expand Down
26 changes: 15 additions & 11 deletions cmd/liqonet/route-operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/metrics/server"

routeoperator "github.com/liqotech/liqo/internal/liqonet/route-operator"
liqoconst "github.com/liqotech/liqo/pkg/consts"
Expand Down Expand Up @@ -104,9 +105,11 @@ func runRouteOperator(commonFlags *liqonetCommonFlags, routeFlags *routeOperator

smcLabelSelector := labels.NewSelector().Add(*smcLabelRequirement)
mainMgr, err := ctrl.NewManager(restcfg.SetRateLimiter(ctrl.GetConfigOrDie()), ctrl.Options{
MapperProvider: mapper.LiqoMapperProvider(scheme),
Scheme: scheme,
MetricsBindAddress: commonFlags.metricsAddr,
MapperProvider: mapper.LiqoMapperProvider(scheme),
Scheme: scheme,
Metrics: server.Options{
BindAddress: commonFlags.metricsAddr,
},
NewCache: func(config *rest.Config, opts cache.Options) (cache.Cache, error) {
opts.ByObject = map[client.Object]cache.ByObject{
&corev1.Pod{}: {
Expand All @@ -129,17 +132,18 @@ func runRouteOperator(commonFlags *liqonetCommonFlags, routeFlags *routeOperator
// This manager is used by the overlay operator and it is limited to the pods running
// on the same namespace as the operator.
overlayMgr, err := ctrl.NewManager(mainMgr.GetConfig(), ctrl.Options{
MapperProvider: mapper.LiqoMapperProvider(scheme),
Scheme: scheme,
MetricsBindAddress: ":0",
Namespace: podNamespace,
NewCache: func(config *rest.Config, opts cache.Options) (cache.Cache, error) {
opts.ByObject = map[client.Object]cache.ByObject{
MapperProvider: mapper.LiqoMapperProvider(scheme),
Scheme: scheme,
Metrics: server.Options{BindAddress: "0"}, // Disable the metrics of the auxiliary manager to prevent conflicts.
Cache: cache.Options{
DefaultNamespaces: map[string]cache.Config{
podNamespace: {},
},
ByObject: map[client.Object]cache.ByObject{
&corev1.Pod{}: {
Label: ovcLabelSelector,
},
}
return cache.New(config, opts)
},
},
})
if err != nil {
Expand Down
11 changes: 5 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ require (
k8s.io/metrics v0.28.2
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2
sigs.k8s.io/aws-iam-authenticator v0.6.12
sigs.k8s.io/controller-runtime v0.15.1
sigs.k8s.io/controller-runtime v0.16.2
sigs.k8s.io/sig-storage-lib-external-provisioner/v7 v7.0.1
)

Expand Down Expand Up @@ -239,13 +239,12 @@ require (
go.opentelemetry.io/otel/metric v1.16.0 // indirect
go.opentelemetry.io/otel/trace v1.16.0 // indirect
go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/net v0.17.0 // indirect
go.uber.org/zap v1.25.0 // indirect
golang.org/x/crypto v0.13.0 // indirect
golang.org/x/net v0.15.0 // indirect
golang.org/x/oauth2 v0.11.0 // indirect
golang.org/x/term v0.13.0 // indirect
golang.org/x/term v0.12.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.13.0 // indirect
golang.zx2c4.com/wireguard v0.0.0-20220904105730-b51010ba13f0 // indirect
Expand Down
22 changes: 10 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -863,14 +863,12 @@ go.opentelemetry.io/otel/trace v1.16.0/go.mod h1:Yt9vYq1SdNz3xdjZZK7wcXv1qv2pwLk
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
go.starlark.net v0.0.0-20230525235612-a134d8f9ddca h1:VdD38733bfYv5tUZwEIskMM93VanwNIi5bIKnDrJdEY=
go.starlark.net v0.0.0-20230525235612-a134d8f9ddca/go.mod h1:jxU+3+j+71eXOW14274+SmmuW82qJzl6iZSeqEtTGds=
go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ=
go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A=
go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60=
go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg=
go.uber.org/zap v1.25.0 h1:4Hvk6GtkucQ790dqmj7l1eEnRdKm3k3ZUrUMS2d5+5c=
go.uber.org/zap v1.25.0/go.mod h1:JIAUzQIH94IC4fOJQm7gMmBJP5k7wQfdcnYdPoEXJYk=
go4.org/netipx v0.0.0-20220925034521-797b0c90d8ab h1:+yW1yrZ09EYNu1spCUOHBBNRbrLnfmutwyhbhCv3b6Q=
go4.org/netipx v0.0.0-20220925034521-797b0c90d8ab/go.mod h1:tgPU4N2u9RByaTN3NC2p9xOzyFpte4jYwsIIRF7XlSc=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
Expand All @@ -893,8 +891,8 @@ golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4
golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc=
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck=
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
Expand Down Expand Up @@ -974,8 +972,8 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8=
golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand Down Expand Up @@ -1069,8 +1067,8 @@ golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek=
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
golang.org/x/term v0.12.0 h1:/ZfYdc3zq+q02Rv9vGqTeSItdzZTSNDmfTi0mBAuidU=
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down Expand Up @@ -1311,8 +1309,8 @@ rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
sigs.k8s.io/aws-iam-authenticator v0.6.12 h1:XlW7djx+FqvyIysdBN60AIKBvHMr+MWVT87U0cG+Qlk=
sigs.k8s.io/aws-iam-authenticator v0.6.12/go.mod h1:uh/d/yhtzJXBdevntKgTKRaabgD2T/JI/YdV+9IaycE=
sigs.k8s.io/controller-runtime v0.15.1 h1:9UvgKD4ZJGcj24vefUFgZFP3xej/3igL9BsOUTb/+4c=
sigs.k8s.io/controller-runtime v0.15.1/go.mod h1:7ngYvp1MLT+9GeZ+6lH3LOlcHkp/+tzA/fmHa4iq9kk=
sigs.k8s.io/controller-runtime v0.16.2 h1:mwXAVuEk3EQf478PQwQ48zGOXvW27UJc8NHktQVuIPU=
sigs.k8s.io/controller-runtime v0.16.2/go.mod h1:vpMu3LpI5sYWtujJOa2uPK61nB5rbwlN7BAB8aSLvGU=
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/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3 h1:XX3Ajgzov2RKUdc5jW3t5jwY7Bo7dcRm+tFxT+NfgY0=
Expand Down
5 changes: 3 additions & 2 deletions internal/liqonet/route-operator/overlayOperator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/envtest"
"sigs.k8s.io/controller-runtime/pkg/metrics/server"

liqoerrors "github.com/liqotech/liqo/pkg/liqonet/errors"
"github.com/liqotech/liqo/pkg/liqonet/overlay"
Expand Down Expand Up @@ -400,8 +401,8 @@ func setupOverlayTestEnv() error {
return err
}
mgr, err := ctrl.NewManager(config, ctrl.Options{
Scheme: overlayScheme,
MetricsBindAddress: "0",
Scheme: overlayScheme,
Metrics: server.Options{BindAddress: "0"}, // this avoids port binding collision
})
go func() {
if err = mgr.Start(context.Background()); err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
controllerruntime "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/envtest"
"sigs.k8s.io/controller-runtime/pkg/metrics/server"
"sigs.k8s.io/controller-runtime/pkg/reconcile"

"github.com/liqotech/liqo/apis/discovery/v1alpha1"
Expand Down Expand Up @@ -125,8 +126,8 @@ var _ = BeforeSuite(func() {
config, err := envTest.Start()
Expect(err).ShouldNot(HaveOccurred())
mgr, err := controllerruntime.NewManager(config, controllerruntime.Options{
Scheme: scheme.Scheme,
MetricsBindAddress: "0",
Scheme: scheme.Scheme,
Metrics: server.Options{BindAddress: "0"}, // this avoids port binding collision
})
Expect(err).ShouldNot(HaveOccurred())
controller, err = NewNatMappingController(mgr.GetClient(), &readyClustersMutex, readyClusters, iptNetns)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/envtest"
"sigs.k8s.io/controller-runtime/pkg/metrics/server"

discoveryv1alpha1 "github.com/liqotech/liqo/apis/discovery/v1alpha1"
sharingv1alpha1 "github.com/liqotech/liqo/apis/sharing/v1alpha1"
Expand Down Expand Up @@ -79,8 +80,8 @@ func createCluster() {

By("Starting a new manager")
k8sManager, err := ctrl.NewManager(cfg, ctrl.Options{
Scheme: scheme.Scheme,
MetricsBindAddress: "0", // this avoids port binding collision
Scheme: scheme.Scheme,
Metrics: server.Options{BindAddress: "0"}, // this avoids port binding collision
})
Expect(err).ToNot(HaveOccurred())
// Disabling panic on failure.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/envtest"
"sigs.k8s.io/controller-runtime/pkg/metrics/server"

discoveryv1alpha1 "github.com/liqotech/liqo/apis/discovery/v1alpha1"
mapsv1alpha1 "github.com/liqotech/liqo/apis/virtualkubelet/v1alpha1"
Expand Down Expand Up @@ -114,8 +115,8 @@ var _ = BeforeSuite(func() {
// +kubebuilder:scaffold:scheme

k8sManager, err := ctrl.NewManager(cfg, ctrl.Options{
Scheme: scheme.Scheme,
MetricsBindAddress: "0", // this avoids port binding collision
Scheme: scheme.Scheme,
Metrics: server.Options{BindAddress: "0"}, // this avoids port binding collision
})
Expect(err).ToNot(HaveOccurred())

Expand Down
5 changes: 3 additions & 2 deletions pkg/utils/testutil/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/envtest"
"sigs.k8s.io/controller-runtime/pkg/manager"
"sigs.k8s.io/controller-runtime/pkg/metrics/server"

discoveryv1alpha1 "github.com/liqotech/liqo/apis/discovery/v1alpha1"
netv1alpha1 "github.com/liqotech/liqo/apis/net/v1alpha1"
Expand Down Expand Up @@ -75,8 +76,8 @@ func NewTestCluster(crdPath []string) (Cluster, manager.Manager, error) {
utilruntime.Must(virtualkubeletv1alpha1.AddToScheme(scheme.Scheme))

mgr, err := ctrl.NewManager(cluster.cfg, ctrl.Options{
Scheme: scheme.Scheme,
MetricsBindAddress: "0", // this avoids port binding collision
Scheme: scheme.Scheme,
Metrics: server.Options{BindAddress: "0"}, // this avoids port binding collision
})
if err != nil {
klog.Error(err)
Expand Down
Loading

0 comments on commit 3b52571

Please sign in to comment.