From ff610e80af8fac0d1bd0c960d88ad634106bf654 Mon Sep 17 00:00:00 2001 From: CrystalChun Date: Wed, 7 Jun 2023 12:19:33 -0700 Subject: [PATCH] [release-ocm-2.7] MGMT-14871: Copy Day2 BMH if Agent is installing https://issues.redhat.com//browse/MGMT-14871 Backport to ACM 2.7 Cherry pick of https://github.com/openshift/assisted-service/pull/5250 Original description: OCPBUGS-7076 Previously the BMAC would copy the BMH and Machine CRs of a Day2 worker to the spoke cluster before the Agent began installing. If the Agent doesn't start installing within the two hours these CRs were copied over, the CSRs for these nodes will not be approved by the machine approver pod. To prevent this from happening, only copy the BMH and Machine CRs to the spoke cluster when the Agent has started installing. --- internal/controller/controllers/bmh_agent_controller.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/controller/controllers/bmh_agent_controller.go b/internal/controller/controllers/bmh_agent_controller.go index afee52415bc..2ab284b5439 100644 --- a/internal/controller/controllers/bmh_agent_controller.go +++ b/internal/controller/controllers/bmh_agent_controller.go @@ -40,6 +40,7 @@ import ( machinev1beta1 "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" "github.com/pkg/errors" "github.com/sirupsen/logrus" + "github.com/thoas/go-funk" corev1 "k8s.io/api/core/v1" k8serrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"