Skip to content

Commit 56d78d9

Browse files
committed
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 <[email protected]>
1 parent f6b41da commit 56d78d9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

apis/dataplane/v1beta1/openstackdataplanenodeset_webhook.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,17 @@ func (r *OpenStackDataPlaneNodeSet) ValidateUpdate(old runtime.Object) (admissio
198198
}
199199
}
200200
}
201+
if oldNodeSet.Status.DeploymentStatuses != nil {
202+
for deployName, deployConditions := range oldNodeSet.Status.DeploymentStatuses {
203+
deployCondition := deployConditions.Get(NodeSetDeploymentReadyCondition)
204+
if !deployConditions.IsTrue(NodeSetDeploymentReadyCondition) && condition.IsError(deployCondition) {
205+
return admission.Warnings{
206+
fmt.Sprintf(`the NodeSet has been updated, but there is a failing OpenStackDataPlaneDeployment in the cluster: %s
207+
This will block updates to the Ansible inventory until the failing deployment has been deleted.`, deployName),
208+
}, nil
209+
}
210+
}
211+
}
201212

202213
return nil, nil
203214
}

0 commit comments

Comments
 (0)