diff --git a/api/v1alpha1/ionoscloudmachine_types.go b/api/v1alpha1/ionoscloudmachine_types.go index 9f5d1b2..892ab6a 100644 --- a/api/v1alpha1/ionoscloudmachine_types.go +++ b/api/v1alpha1/ionoscloudmachine_types.go @@ -94,7 +94,6 @@ type IONOSCloudMachineStatus struct { //+kubebuilder:printcolumn:name="Ram",type=integer,JSONPath=`.spec.ram` //+kubebuilder:printcolumn:name="ProviderID",type=string,JSONPath=`.spec.providerID` - // IONOSCloudMachine is the Schema for the ionoscloudmachines API type IONOSCloudMachine struct { metav1.TypeMeta `json:",inline"` diff --git a/api/v1alpha1/webhook_suite_test.go b/api/v1alpha1/webhook_suite_test.go index c42e119..35b85f0 100644 --- a/api/v1alpha1/webhook_suite_test.go +++ b/api/v1alpha1/webhook_suite_test.go @@ -32,6 +32,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/envtest" logf "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/log/zap" + metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server" ) // These tests use Ginkgo (BDD-style Go testing framework). Refer to @@ -81,9 +82,9 @@ var _ = BeforeSuite(func() { // start webhook server using Manager mgr, err := ctrl.NewManager(cfg, ctrl.Options{ - Scheme: scheme, - LeaderElection: false, - MetricsBindAddress: "0", + Scheme: scheme, + LeaderElection: false, + Metrics: metricsserver.Options{BindAddress: "0"}, }) Expect(err).NotTo(HaveOccurred()) diff --git a/cmd/main.go b/cmd/main.go index 0ccf0da..d801767 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -33,6 +33,7 @@ import ( ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/healthz" "sigs.k8s.io/controller-runtime/pkg/log/zap" + metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" @@ -72,8 +73,7 @@ func main() { mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{ Scheme: scheme, - MetricsBindAddress: metricsAddr, - Port: 9443, + Metrics: metricsserver.Options{BindAddress: metricsAddr}, HealthProbeBindAddress: probeAddr, LeaderElection: enableLeaderElection, LeaderElectionID: "2606507e.cluster.x-k8s.io",