From 98fb3d615d4ca13d876e322c507052501d4af0c6 Mon Sep 17 00:00:00 2001 From: MrCode-2005 Date: Mon, 17 Aug 2026 23:42:27 +0530 Subject: [PATCH 1/2] config/types: allow deleting partitions by label Partitions can be addressed by Number or by Label. When a user wants to delete a partition, they set ShouldExist: false and identify it. Previously, the validation logic incorrectly included the Label field in the forbidden-fields list when ShouldExist is false, making it impossible to delete a partition by label. This commit removes Label from that validation check. --- config/v3_6/types/partition.go | 2 +- config/v3_7_experimental/types/partition.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/v3_6/types/partition.go b/config/v3_6/types/partition.go index 1b2d97edf1..d1adfc7e09 100644 --- a/config/v3_6/types/partition.go +++ b/config/v3_6/types/partition.go @@ -46,7 +46,7 @@ func (p Partition) Key() string { func (p Partition) Validate(c path.ContextPath) (r report.Report) { if util.IsFalse(p.ShouldExist) && - (p.Label != nil || util.NotEmpty(p.TypeGUID) || util.NotEmpty(p.GUID) || p.StartMiB != nil || p.SizeMiB != nil) { + (util.NotEmpty(p.TypeGUID) || util.NotEmpty(p.GUID) || p.StartMiB != nil || p.SizeMiB != nil) { r.AddOnError(c, errors.ErrShouldNotExistWithOthers) } if p.Number == 0 && p.Label == nil { diff --git a/config/v3_7_experimental/types/partition.go b/config/v3_7_experimental/types/partition.go index 1b2d97edf1..d1adfc7e09 100644 --- a/config/v3_7_experimental/types/partition.go +++ b/config/v3_7_experimental/types/partition.go @@ -46,7 +46,7 @@ func (p Partition) Key() string { func (p Partition) Validate(c path.ContextPath) (r report.Report) { if util.IsFalse(p.ShouldExist) && - (p.Label != nil || util.NotEmpty(p.TypeGUID) || util.NotEmpty(p.GUID) || p.StartMiB != nil || p.SizeMiB != nil) { + (util.NotEmpty(p.TypeGUID) || util.NotEmpty(p.GUID) || p.StartMiB != nil || p.SizeMiB != nil) { r.AddOnError(c, errors.ErrShouldNotExistWithOthers) } if p.Number == 0 && p.Label == nil { From affa66a3f768a2592d530401717a9293a9b5bb8e Mon Sep 17 00:00:00 2001 From: MrCode-2005 Date: Tue, 18 Aug 2026 12:54:33 +0530 Subject: [PATCH 2/2] Revert changes to frozen config/v3_6 spec --- config/v3_6/types/partition.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/v3_6/types/partition.go b/config/v3_6/types/partition.go index d1adfc7e09..1b2d97edf1 100644 --- a/config/v3_6/types/partition.go +++ b/config/v3_6/types/partition.go @@ -46,7 +46,7 @@ func (p Partition) Key() string { func (p Partition) Validate(c path.ContextPath) (r report.Report) { if util.IsFalse(p.ShouldExist) && - (util.NotEmpty(p.TypeGUID) || util.NotEmpty(p.GUID) || p.StartMiB != nil || p.SizeMiB != nil) { + (p.Label != nil || util.NotEmpty(p.TypeGUID) || util.NotEmpty(p.GUID) || p.StartMiB != nil || p.SizeMiB != nil) { r.AddOnError(c, errors.ErrShouldNotExistWithOthers) } if p.Number == 0 && p.Label == nil {