diff --git a/cmd/main.go b/cmd/main.go index 143f8b6..c794241 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -19,7 +19,11 @@ package main import ( "flag" "os" + "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/metrics" + "sigs.k8s.io/controller-runtime/pkg/metrics/server" + "sigs.k8s.io/controller-runtime/pkg/webhook" + // 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/plugin/pkg/client/auth" @@ -82,12 +86,12 @@ func main() { mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{ Scheme: scheme, - MetricsBindAddress: metricsAddr, - Port: 9443, + Metrics: server.Options{BindAddress: metricsAddr}, + WebhookServer: webhook.NewServer(webhook.Options{Port: 9443}), HealthProbeBindAddress: probeAddr, LeaderElection: enableLeaderElection, LeaderElectionID: "ab49af34.appsflyer.com", - DryRunClient: dryrun, + Client: client.Options{DryRun: &dryrun}, // LeaderElectionReleaseOnCancel defines if the leader should step down voluntarily // when the Manager ends. This requires the binary to immediately end when the // Manager is stopped, otherwise, this setting is unsafe. Setting this significantly diff --git a/test/objects/PersistentVolumeClaim.go b/test/objects/PersistentVolumeClaim.go index 82164f3..2917196 100644 --- a/test/objects/PersistentVolumeClaim.go +++ b/test/objects/PersistentVolumeClaim.go @@ -40,7 +40,7 @@ func (_ persistentVolumeClaim) Create(name, storageClassName string, annotations AccessModes: []corev1.PersistentVolumeAccessMode{ corev1.ReadWriteOnce, }, - Resources: corev1.ResourceRequirements{ + Resources: corev1.VolumeResourceRequirements{ Requests: corev1.ResourceList{ corev1.ResourceStorage: resource.MustParse("1Gi"), },