Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions internal/controller/onboarding_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down