From 338efd0211055610476e958c97aa76e4996ccd65 Mon Sep 17 00:00:00 2001 From: Peng Liu Date: Tue, 13 Apr 2021 22:09:08 -0400 Subject: [PATCH] Respect status.Migration in network.config when exsits When status.Migration is set in network.config. MCO shall render the node according to the target networkType. --- pkg/operator/render.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/operator/render.go b/pkg/operator/render.go index 9c91f3e157..0df2335150 100644 --- a/pkg/operator/render.go +++ b/pkg/operator/render.go @@ -122,6 +122,9 @@ func createDiscoveredControllerConfigSpec(infra *configv1.Infrastructure, networ if network.Status.NetworkType == "" { // At install time, when CNO has not started, status is unset, use the value in spec. ccSpec.NetworkType = network.Spec.NetworkType + } else if network.Status.Migration != nil { + // At sdn migration prepare phase, use the value in status.migration to prepare the node. + ccSpec.NetworkType = network.Status.Migration.NetworkType } else { // After installation, the MCO should not assume the network is changing just because the spec changed, it needs to wait until CNO updates the status. ccSpec.NetworkType = network.Status.NetworkType