From 6369c79204e7e352310417efda21ea30ee3520c7 Mon Sep 17 00:00:00 2001 From: Stefan Majewsky Date: Thu, 27 Aug 2026 14:49:37 +0200 Subject: [PATCH] fix new lints for Go 1.27 Signed-off-by: Stefan Majewsky --- internal/controller/onboarding_controller.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/controller/onboarding_controller.go b/internal/controller/onboarding_controller.go index 1f52d0e7..3c03246f 100644 --- a/internal/controller/onboarding_controller.go +++ b/internal/controller/onboarding_controller.go @@ -423,7 +423,7 @@ func (r *OnboardingController) ensureNovaProperties(ctx context.Context, hv *kvm return errRequeue } - shortHypervisorAddress := strings.SplitN(hypervisorAddress, ".", 2)[0] + shortHypervisorAddress, _, _ := strings.Cut(hypervisorAddress, ".") hypervisorQuery := hypervisors.ListOpts{HypervisorHostnamePattern: &shortHypervisorAddress} hypervisorPages, err := hypervisors.List(r.computeClient, hypervisorQuery).AllPages(ctx) @@ -446,7 +446,7 @@ func (r *OnboardingController) ensureNovaProperties(ctx context.Context, hv *kvm var found = false var myHypervisor hypervisors.Hypervisor for _, h := range hs { - short := strings.SplitN(h.HypervisorHostname, ".", 2)[0] + short, _, _ := strings.Cut(h.HypervisorHostname, ".") if short == shortHypervisorAddress { myHypervisor = h found = true