mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-18 13:57:38 +00:00
Add DRA test for device attribute with no value set
Test that declarative validation catches a DeviceAttribute with no value fields set, which was the original bug scenario where union ratcheting incorrectly skipped validation for new map entries.
This commit is contained in:
@@ -304,6 +304,13 @@ func TestDeclarativeValidateUpdate(t *testing.T) {
|
||||
field.Invalid(field.NewPath("spec", "devices").Index(0).Child("attributes").Key("test.io/multiple"), "", "").WithOrigin("union").MarkAlpha(),
|
||||
},
|
||||
},
|
||||
"invalid update: device attribute no value": {
|
||||
old: mkResourceSliceWithDevices(),
|
||||
update: mkResourceSliceWithDevices(tweakDeviceAttribute("test.io/empty", resource.DeviceAttribute{})),
|
||||
expectedErrs: field.ErrorList{
|
||||
field.Invalid(field.NewPath("spec", "devices").Index(0).Child("attributes").Key("test.io/empty"), "", "").WithOrigin("union").MarkAlpha(),
|
||||
},
|
||||
},
|
||||
// spec.sharedCounters
|
||||
"valid update: at limit shared counters": {
|
||||
old: mkResourceSliceWithSharedCounters(),
|
||||
|
||||
Reference in New Issue
Block a user