From 3ffa4700828de339bbc3c9e6b2cabebaa51ac025 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Mon, 11 Apr 2022 14:11:57 -0400 Subject: [PATCH] machine/convert: reverse machineSpec.Ports order When building the `machineSpec.Ports` parameter, we need to take in account the networks first, and then the additional ports. The reason is that when using the legacy cloud provider, the main interface (from a Nova standpoint) will be used to bind the kubelet process and this changes when using the new cloud provider with CCM. --- pkg/machine/convert.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/machine/convert.go b/pkg/machine/convert.go index d33eb933c..dc6e5bf34 100644 --- a/pkg/machine/convert.go +++ b/pkg/machine/convert.go @@ -353,7 +353,9 @@ func providerSpecToMachineSpec(ps *openstackconfigv1.OpenstackProviderSpec, apiV portList = append(portList, ports...) } - machineSpec.Ports = append(machineSpec.Ports, portList...) + // The order of the networks is important, first network is the one that will be used for kubelet when + // the legacy cloud provider is used. Once we switch to using CCM by default, the order won't matter. + machineSpec.Ports = append(portList, machineSpec.Ports...) return machineSpec, nil }