Skip to content

Validate Intel RDT fields by CDI version#319

Draft
elezar wants to merge 1 commit into
cncf-tags:mainfrom
elezar:fix-intel-rdt-version-validation
Draft

Validate Intel RDT fields by CDI version#319
elezar wants to merge 1 commit into
cncf-tags:mainfrom
elezar:fix-intel-rdt-version-validation

Conversation

@elezar

@elezar elezar commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Fixes #315.

This makes Intel RDT validation aware of the declared CDI spec version. Legacy enableCMT/enableMBM fields are accepted for specs before v1.1.0 and rejected for v1.1.0+, while v1.1.0-only fields such as enableMonitoring and schemata are rejected for older declared versions. The raw-content validation path catches false-valued fields that are otherwise indistinguishable from omitted bools after unmarshalling.

The change also restores legacy IntelRdt fields in specs-go for compatibility and maps legacy monitoring booleans to OCI EnableMonitoring when applying edits.

Tests:

  • go test ./pkg/cdi -run 'TestParseSpecIntelRdtVersionCompatibility|TestNewSpec|TestRequiredVersion|TestApplyContainerEdits/empty_spec,_legacy_rdt_monitoring'
  • go test . ./schema
  • go test . ./specs-go

@elezar elezar marked this pull request as draft June 26, 2026 12:28
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.

Validation is not declared-version-aware for IntelRdt fields

1 participant