Skip to content

Commit

Permalink
Bump dependencies (#173)
Browse files Browse the repository at this point in the history
* bump all dependencies

* replace depretaced pointer with ptr

pointer is deprecated: https://pkg.go.dev/k8s.io/utils/pointer

* remove deprecated funcs from controller-runtime

here is an overview of all deprecated and removed functions and structs: https://github.com/kubernetes-sigs/controller-runtime/pull/2422/files
  • Loading branch information
friedrichwilken authored Oct 20, 2023
1 parent 08b9ec6 commit 9bf7307
Show file tree
Hide file tree
Showing 12 changed files with 117 additions and 76 deletions.
20 changes: 13 additions & 7 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,35 +28,40 @@ import (

"github.com/go-logr/zapr"

"github.com/kyma-project/eventing-manager/pkg/env"
subscriptionv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1"
subscriptionv1alpha2 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha2"

"github.com/kyma-project/eventing-manager/pkg/env"

"github.com/kyma-project/eventing-manager/pkg/subscriptionmanager/jetstream"

"github.com/kyma-project/eventing-manager/pkg/eventing"
"github.com/kyma-project/eventing-manager/pkg/k8s"

apiclientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"

eventingcontroller "github.com/kyma-project/eventing-manager/internal/controller/eventing"
"github.com/kyma-project/eventing-manager/options"
backendmetrics "github.com/kyma-project/eventing-manager/pkg/backend/metrics"
"github.com/kyma-project/eventing-manager/pkg/logger"
apiclientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"

// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
// to ensure that exec-entrypoint and run can make use of them.
"k8s.io/client-go/dynamic"
_ "k8s.io/client-go/plugin/pkg/client/auth"

apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/healthz"

apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
"sigs.k8s.io/controller-runtime/pkg/metrics/server"
"sigs.k8s.io/controller-runtime/pkg/webhook"

apigatewayv1beta1 "github.com/kyma-incubator/api-gateway/api/v1beta1"

eventingv1alpha1 "github.com/kyma-project/eventing-manager/api/v1alpha1"
//+kubebuilder:scaffold:imports
)
Expand Down Expand Up @@ -113,14 +118,15 @@ func main() { //nolint:funlen // main function needs to initialize many object

// setup ctrl manager
k8sRestCfg := ctrl.GetConfigOrDie()

mgr, err := ctrl.NewManager(k8sRestCfg, ctrl.Options{
Scheme: scheme,
MetricsBindAddress: opts.MetricsAddr,
Port: 9443,
HealthProbeBindAddress: opts.ProbeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: leaderElectionID,
SyncPeriod: &opts.ReconcilePeriod,
WebhookServer: webhook.NewServer(webhook.Options{Port: 9443}),
Cache: cache.Options{SyncPeriod: &opts.ReconcilePeriod},
Metrics: server.Options{BindAddress: opts.MetricsAddr},
})
if err != nil {
setupLog.Error(err, "unable to start manager")
Expand Down
13 changes: 7 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ require (
github.com/google/uuid v1.3.1
github.com/kelseyhightower/envconfig v1.4.0
github.com/kyma-incubator/api-gateway v0.0.0-20220819093753-296e6704d413
github.com/kyma-project/kyma/common/logging v0.0.0-20230616102347-ad6927dc28d5
github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20231006112231-696ba866d5ec
github.com/kyma-project/kyma/common/logging v0.0.0-20231020092259-d58329d50da1
github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20231020092259-d58329d50da1
github.com/kyma-project/nats-manager v1.0.2
github.com/mitchellh/hashstructure/v2 v2.0.2
github.com/nats-io/nats-server/v2 v2.10.3
Expand All @@ -25,20 +25,20 @@ require (
go.uber.org/atomic v1.11.0
go.uber.org/zap v1.26.0
golang.org/x/oauth2 v0.13.0
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028
k8s.io/api v0.28.3
k8s.io/apiextensions-apiserver v0.28.3
k8s.io/apimachinery v0.28.3
k8s.io/client-go v0.28.3
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2
sigs.k8s.io/controller-runtime v0.15.2
k8s.io/utils v0.0.0-20230726121419-3b25d923346b
sigs.k8s.io/controller-runtime v0.16.3
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.10.1 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
Expand Down Expand Up @@ -74,6 +74,7 @@ require (
github.com/stretchr/objx v0.5.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/term v0.13.0 // indirect
Expand Down
12 changes: 12 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/emicklei/go-restful/v3 v3.10.1 h1:rc42Y5YTp7Am7CS630D7JmhRjq4UlEUuEKfrDac4bSQ=
github.com/emicklei/go-restful/v3 v3.10.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g=
github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U=
github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww=
Expand Down Expand Up @@ -95,10 +97,14 @@ github.com/kyma-project/api-gateway v0.0.0-20220819093753-296e6704d413 h1:fkGKNO
github.com/kyma-project/api-gateway v0.0.0-20220819093753-296e6704d413/go.mod h1:5kBV6C2JEaapjTAn10Mo81Te4e6LN3epexUCSLXgQLI=
github.com/kyma-project/kyma/common/logging v0.0.0-20230616102347-ad6927dc28d5 h1:Uey3jJWq9eyXiepEvqQjBIWwPGM8nMIylBpcTc9FuDM=
github.com/kyma-project/kyma/common/logging v0.0.0-20230616102347-ad6927dc28d5/go.mod h1:JGb5RBi8Uz+RZ/jf54+qA+RqY6uPQBJ8pO1w3KSwm1Q=
github.com/kyma-project/kyma/common/logging v0.0.0-20231020092259-d58329d50da1 h1:Lur/R654ghUmsZiNrSrQBDjxCAvkb/7CueB0X/VQbKg=
github.com/kyma-project/kyma/common/logging v0.0.0-20231020092259-d58329d50da1/go.mod h1:JGb5RBi8Uz+RZ/jf54+qA+RqY6uPQBJ8pO1w3KSwm1Q=
github.com/kyma-project/kyma/components/application-operator v0.0.0-20230127165033-ec8e43477eca h1:7UpCIk6+sMCOhPfolAlppRugSln5M4T8/dHJm8x0erc=
github.com/kyma-project/kyma/components/application-operator v0.0.0-20230127165033-ec8e43477eca/go.mod h1:Tog02gZ1VT7yvFmhSqmiuGZpDYt18zTF4kr6E0N9ttk=
github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20231006112231-696ba866d5ec h1:P+V9r14NJKUFbIZIEMrjInABT+qN/ySLqWQ01aeq068=
github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20231006112231-696ba866d5ec/go.mod h1:Ht1hT95iSKe5md3QhIZQrq3j9WXkiWe/qdDMaDrmdyI=
github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20231020092259-d58329d50da1 h1:DeK2GvRpL2YPPkCguEN376Lj6dlKkjwn1Z4Df1LHatg=
github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20231020092259-d58329d50da1/go.mod h1:llsnpySZ+YAB6WrWplNWbGdnYYPmMlUMXEhFl0sXtsE=
github.com/kyma-project/nats-manager v1.0.2 h1:uJiVrLFFqnOsnz1IGNn76fm5cQoK+4L8GxP829mX2C8=
github.com/kyma-project/nats-manager v1.0.2/go.mod h1:gC0W/C2NgpmVnG/5v5f76ijNw5aloQLEkSuVOElB9gk=
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
Expand Down Expand Up @@ -256,6 +262,8 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk=
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU=
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90=
gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw=
gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY=
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
Expand Down Expand Up @@ -304,8 +312,12 @@ k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5Ohx
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-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI=
k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
sigs.k8s.io/controller-runtime v0.15.2 h1:9V7b7SDQSJ08IIsJ6CY1CE85Okhp87dyTMNDG0FS7f4=
sigs.k8s.io/controller-runtime v0.15.2/go.mod h1:7ngYvp1MLT+9GeZ+6lH3LOlcHkp/+tzA/fmHa4iq9kk=
sigs.k8s.io/controller-runtime v0.16.3 h1:2TuvuokmfXvDUamSx1SuAOO3eTyye+47mJCigwG62c4=
sigs.k8s.io/controller-runtime v0.16.3/go.mod h1:j7bialYoSn142nv9sCOJmQgDXQXxnroFU4VnX/brVJ0=
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.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE=
Expand Down
6 changes: 3 additions & 3 deletions hack/e2e/common/testenvironment/test_environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
k8stypes "k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/kubernetes"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/kyma-project/eventing-manager/hack/e2e/common"
Expand Down Expand Up @@ -264,7 +264,7 @@ func (te *TestEnvironment) CreateSinkDeployment(name, namespace, image string) e
return te.K8sClient.Patch(te.Context, fixtures.NewSinkDeployment(name, namespace, image),
client.Apply,
&client.PatchOptions{
Force: pointer.Bool(true),
Force: ptr.To(true),
FieldManager: fixtures.FieldManager,
})
})
Expand All @@ -275,7 +275,7 @@ func (te *TestEnvironment) CreateSinkService(name, namespace string) error {
return te.K8sClient.Patch(te.Context, fixtures.NewSinkService(name, namespace),
client.Apply,
&client.PatchOptions{
Force: pointer.Bool(true),
Force: ptr.To(true),
FieldManager: fixtures.FieldManager,
})
})
Expand Down
23 changes: 14 additions & 9 deletions internal/controller/subscription/eventmesh/test/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import (

"github.com/avast/retry-go/v3"
"github.com/go-logr/zapr"
apigatewayv1beta1 "github.com/kyma-incubator/api-gateway/api/v1beta1"
kymalogger "github.com/kyma-project/kyma/common/logging/logger"
"github.com/stretchr/testify/require"
corev1 "k8s.io/api/core/v1"
k8serrors "k8s.io/apimachinery/pkg/api/errors"
Expand All @@ -25,13 +27,15 @@ import (
"k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/rest"
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/envtest"
logf "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"

apigatewayv1beta1 "github.com/kyma-incubator/api-gateway/api/v1beta1"
kymalogger "github.com/kyma-project/kyma/common/logging/logger"
eventingv1alpha2 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha2"

eventmeshreconciler "github.com/kyma-project/eventing-manager/internal/controller/subscription/eventmesh"
"github.com/kyma-project/eventing-manager/pkg/backend/cleaner"
Expand All @@ -47,7 +51,6 @@ import (
"github.com/kyma-project/eventing-manager/pkg/utils"
testutils "github.com/kyma-project/eventing-manager/test/utils"
reconcilertesting "github.com/kyma-project/eventing-manager/testing"
eventingv1alpha2 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha2"
)

type eventMeshTestEnsemble struct {
Expand Down Expand Up @@ -117,13 +120,15 @@ func setupSuite() error {
syncPeriod := syncPeriodSeconds * time.Second
webhookInstallOptions := &emTestEnsemble.testEnv.WebhookInstallOptions
k8sManager, err := ctrl.NewManager(cfg, ctrl.Options{
Scheme: scheme.Scheme,
SyncPeriod: &syncPeriod,
Host: webhookInstallOptions.LocalServingHost,
Port: webhookInstallOptions.LocalServingPort,
CertDir: webhookInstallOptions.LocalServingCertDir,
MetricsBindAddress: "0", // disable
Cache: cache.Options{SyncPeriod: &syncPeriod},
HealthProbeBindAddress: "0", // disable
Scheme: scheme.Scheme,
Metrics: server.Options{BindAddress: "0"}, // disable
WebhookServer: webhook.NewServer(webhook.Options{
Port: webhookInstallOptions.LocalServingPort,
Host: webhookInstallOptions.LocalServingHost,
CertDir: webhookInstallOptions.LocalServingCertDir,
}),
})
if err != nil {
return err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ import (
"k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/rest"
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/envtest"
logf "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"

apigatewayv1beta1 "github.com/kyma-incubator/api-gateway/api/v1beta1"
kymalogger "github.com/kyma-project/kyma/common/logging/logger"
Expand Down Expand Up @@ -119,12 +122,14 @@ func setupSuite() error {
webhookInstallOptions := &emTestEnsemble.testEnv.WebhookInstallOptions
k8sManager, err := ctrl.NewManager(cfg, ctrl.Options{
Scheme: scheme.Scheme,
SyncPeriod: &syncPeriod,
Host: webhookInstallOptions.LocalServingHost,
Port: webhookInstallOptions.LocalServingPort,
CertDir: webhookInstallOptions.LocalServingCertDir,
MetricsBindAddress: "0", // disable
HealthProbeBindAddress: "0", // disable
Cache: cache.Options{SyncPeriod: &syncPeriod},
Metrics: server.Options{BindAddress: "0"}, // disable
HealthProbeBindAddress: "0", // disable
WebhookServer: webhook.NewServer(webhook.Options{
Host: webhookInstallOptions.LocalServingHost,
Port: webhookInstallOptions.LocalServingPort,
CertDir: webhookInstallOptions.LocalServingCertDir,
}),
})
if err != nil {
return err
Expand Down
15 changes: 10 additions & 5 deletions internal/controller/subscription/eventmesh/testwithory/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,13 @@ import (
"k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/rest"
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/envtest"
logf "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"

apigatewayv1beta1 "github.com/kyma-incubator/api-gateway/api/v1beta1"
kymalogger "github.com/kyma-project/kyma/common/logging/logger"
Expand Down Expand Up @@ -118,12 +121,14 @@ func setupSuite() error {
webhookInstallOptions := &emTestEnsemble.testEnv.WebhookInstallOptions
k8sManager, err := ctrl.NewManager(cfg, ctrl.Options{
Scheme: scheme.Scheme,
SyncPeriod: &syncPeriod,
Host: webhookInstallOptions.LocalServingHost,
Port: webhookInstallOptions.LocalServingPort,
CertDir: webhookInstallOptions.LocalServingCertDir,
MetricsBindAddress: "0", // disable
HealthProbeBindAddress: "0", // disable
Cache: cache.Options{SyncPeriod: &syncPeriod},
Metrics: server.Options{BindAddress: "0"}, //disable
WebhookServer: webhook.NewServer(webhook.Options{
Host: webhookInstallOptions.LocalServingHost,
Port: webhookInstallOptions.LocalServingPort,
CertDir: webhookInstallOptions.LocalServingCertDir,
}),
})
if err != nil {
return err
Expand Down
15 changes: 10 additions & 5 deletions internal/controller/subscription/jetstream/test_utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ import (
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/validation/field"
"k8s.io/client-go/rest"
"sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/manager"
"sigs.k8s.io/controller-runtime/pkg/metrics/server"
"sigs.k8s.io/controller-runtime/pkg/webhook"

cleanerv1alpha2 "github.com/kyma-project/eventing-manager/pkg/backend/cleaner"
"github.com/kyma-project/eventing-manager/pkg/backend/jetstream"
Expand Down Expand Up @@ -150,12 +153,14 @@ func startReconciler() error {
webhookInstallOptions := &jsTestEnsemble.TestEnv.WebhookInstallOptions
k8sManager, err := ctrl.NewManager(jsTestEnsemble.Cfg, ctrl.Options{
Scheme: scheme.Scheme,
SyncPeriod: &syncPeriod,
Host: webhookInstallOptions.LocalServingHost,
Port: webhookInstallOptions.LocalServingPort,
CertDir: webhookInstallOptions.LocalServingCertDir,
MetricsBindAddress: "0", // disable
HealthProbeBindAddress: "0", // disable
Cache: cache.Options{SyncPeriod: &syncPeriod},
Metrics: server.Options{BindAddress: "0"}, // disable
WebhookServer: webhook.NewServer(webhook.Options{
Host: webhookInstallOptions.LocalServingHost,
Port: webhookInstallOptions.LocalServingPort,
CertDir: webhookInstallOptions.LocalServingCertDir,
}),
})
if err != nil {
return err
Expand Down
10 changes: 5 additions & 5 deletions pkg/eventing/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/kyma-project/eventing-manager/test"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"

"sigs.k8s.io/controller-runtime/pkg/client"

Expand Down Expand Up @@ -163,8 +163,8 @@ func Test_migratePublisherDeploymentFromEC(t *testing.T) {
Kind: "Deployment",
Name: "eventing-controller",
UID: "a3cdcc7b-6853-4772-99cc-fc1511399d63",
Controller: pointer.Bool(true),
BlockOwnerDeletion: pointer.Bool(true),
Controller: ptr.To(true),
BlockOwnerDeletion: ptr.To(true),
}}
return oldPublisher
},
Expand All @@ -191,8 +191,8 @@ func Test_migratePublisherDeploymentFromEC(t *testing.T) {
Kind: "Deployment",
Name: "eventing-manager",
UID: "a3cdcc7b-6853-4772-99cc-fc1511399d63",
Controller: pointer.Bool(true),
BlockOwnerDeletion: pointer.Bool(true),
Controller: ptr.To(true),
BlockOwnerDeletion: ptr.To(true),
}}
return oldPublisher
},
Expand Down
4 changes: 2 additions & 2 deletions pkg/k8s/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
k8sclientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"
"sigs.k8s.io/controller-runtime/pkg/client"
)

Expand Down Expand Up @@ -147,7 +147,7 @@ func (c *KubeClient) GetNATSResources(ctx context.Context, namespace string) (*n
// The object must define `GVK` (i.e. object.TypeMeta).
func (c *KubeClient) PatchApply(ctx context.Context, object client.Object) error {
return c.client.Patch(ctx, object, client.Apply, &client.PatchOptions{
Force: pointer.Bool(true),
Force: ptr.To(true),
FieldManager: c.fieldManager,
})
}
Expand Down
Loading

0 comments on commit 9bf7307

Please sign in to comment.