Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion api/dataplane/v1beta1/openstackdataplanenodeset_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ func (r *OpenStackDataPlaneNodeSet) ValidateUpdate(ctx context.Context, old runt
)

}

var warnings []string

if oldNodeSet.Status.DeploymentStatuses != nil {
for deployName, deployConditions := range oldNodeSet.Status.DeploymentStatuses {
deployCondition := deployConditions.Get(NodeSetDeploymentReadyCondition)
Expand All @@ -172,10 +175,19 @@ func (r *OpenStackDataPlaneNodeSet) ValidateUpdate(ctx context.Context, old runt
deployName, string(deployCondition.Type)),
)
}

// Warn user that a failed deployment blocks inventory updates.
// NodeSet changes won't take effect until the failed deployment is deleted.
if !deployConditions.IsTrue(NodeSetDeploymentReadyCondition) && condition.IsError(deployCondition) {
warnings = append(warnings, fmt.Sprintf(
"NodeSet has been updated, but OpenStackDataPlaneDeployment %s is in a failed state. "+
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need this after #1655. That's probably a stale jira that should be closed. Did you see the issue on FR4/main?

FWIW, now there is no need to delete failed deployments, you can create a new deployment and it would use the updated inventory.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, makes sense. I'll close the PR and issue both.
Thanks

"Inventory changes will not take effect until this deployment is deleted.",
deployName))
}
}
}

return nil, nil
return warnings, nil
}

// ValidateUpdate validates the OpenStackDataPlaneNodeSetSpec on update
Expand Down