From f2b77366c1dd1cef080982fcb4dfcb66851586ab Mon Sep 17 00:00:00 2001 From: Brendan Shephard Date: Tue, 15 Apr 2025 13:20:55 +1000 Subject: [PATCH] Add warning about NodeSet updates with OSDP failures When a NodeSet is updated while it is associated with a failing OSDPD, we will update the NodeSet but NOT update the Ansible inventory. This change adds a warning for users so that they are aware of the fact that the OSDPD needs to be deleted before the Ansible inventory will be updated. Jira: OSPRH-15668 Signed-off-by: Brendan Shephard --- .../v1beta1/openstackdataplanenodeset_webhook.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/apis/dataplane/v1beta1/openstackdataplanenodeset_webhook.go b/apis/dataplane/v1beta1/openstackdataplanenodeset_webhook.go index e9a1f7461..b66c40fc8 100644 --- a/apis/dataplane/v1beta1/openstackdataplanenodeset_webhook.go +++ b/apis/dataplane/v1beta1/openstackdataplanenodeset_webhook.go @@ -198,6 +198,17 @@ func (r *OpenStackDataPlaneNodeSet) ValidateUpdate(old runtime.Object) (admissio } } } + if oldNodeSet.Status.DeploymentStatuses != nil { + for deployName, deployConditions := range oldNodeSet.Status.DeploymentStatuses { + deployCondition := deployConditions.Get(NodeSetDeploymentReadyCondition) + if !deployConditions.IsTrue(NodeSetDeploymentReadyCondition) && condition.IsError(deployCondition) { + return admission.Warnings{ + fmt.Sprintf(`the NodeSet has been updated, but there is a failing OpenStackDataPlaneDeployment in the cluster: %s + This will block updates to the Ansible inventory until the failing deployment has been deleted.`, deployName), + }, nil + } + } + } return nil, nil }