Skip to content

Conversation

@askervin
Copy link
Contributor

@askervin askervin commented Dec 1, 2025

When runtime-tools validator checks mandatory fields, it expects every string field either to be tagged "omitempty" or contain a non-empty string. Linux memory policy modes MPOL_DEFAULT and MPOL_LOCAL must have empty nodes field. This change adds "omitempty" tag to LinuxMemoryPolicy.Nodes in order to pass runtime-tools validation in these modes.

When runtime-tools validator checks mandatory fields, it expects every
string field either to be tagged "omitempty" or contain a non-empty
string. Linux memory policy modes MPOL_DEFAULT and MPOL_LOCAL must
have empty nodes field. This change adds "omitempty" tag to
LinuxMemoryPolicy.Nodes in order to pass runtime-tools validation in
these modes.

Signed-off-by: Antti Kervinen <antti.kervinen@intel.com>
@askervin
Copy link
Contributor Author

askervin commented Dec 1, 2025

@cyphar, when I was testing opencontainers/runtime-tools#786, I noticed that leaving out "omitempty" from LinuxMemoryPolicy.Nodes causes runtime-tools validation checkMandatoryUnit() to report an error if this field contains an empty string. And we actually require empty nodes string in certain memory policy modes (MPOL_DEFAULT, MPOL_LOCAL). I suppose the best fix would be adding "omitempty" to the field spec. WDYT?

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.

1 participant