Skip to content

fix: prevent mkdef partial writes on validation errors#7558

Merged
Obihoernchen merged 1 commit into
xcat2:masterfrom
VersatusHPC:fix/mkdef-partial-object-on-validation-error
May 7, 2026
Merged

fix: prevent mkdef partial writes on validation errors#7558
Obihoernchen merged 1 commit into
xcat2:masterfrom
VersatusHPC:fix/mkdef-partial-object-on-validation-error

Conversation

@viniciusferrao
Copy link
Copy Markdown
Member

This PR fixes a long-standing mkdef failure mode where a command could report a validation error but still leave behind a partial object definition.

The reported case was:

mkdef -t node -o node1 groups=compute bmc=10.0.0.1

Because bmc depends on a valid mgt value, this should fail cleanly. Before this change, mkdef could still create or modify part of the node, which left the user with a broken object and made the corrected command fail on retry.

The fix makes validation failures block writes for the affected object. It also preserves existing objects when mkdef -f fails validation, instead of deleting or partially replacing them first.

Fixes #3706

@Obihoernchen Obihoernchen added this to the 2.18 milestone May 7, 2026
@Obihoernchen Obihoernchen merged commit 5463a7c into xcat2:master May 7, 2026
2 checks passed
@viniciusferrao viniciusferrao deleted the fix/mkdef-partial-object-on-validation-error branch May 7, 2026 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mkdef complains with error, but it still allows the node definition to be created

2 participants