Skip to content

Commit

Permalink
pkg/apis/config: fix balloons config tags.
Browse files Browse the repository at this point in the history
Fix `omitempty` JSON tags for balloons config `PreferCloseToDevices`
and `IdleCpuClass`, so they properly imply optionality in the
corresponding CRD fields.

Tag `PreferFarFromDevices` is considered unstable/untested and should
not be used. Hence, tag it as `"-"` to prevent unmarshalling it from
a CRD to the actual configuration.

Signed-off-by: Krisztian Litkey <[email protected]>
  • Loading branch information
klihub committed Jan 12, 2024
1 parent 0e0544b commit 1e1dad9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/apis/config/v1alpha1/resmgr/policy/balloons/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type Config struct {
PinMemory *bool `json:"pinMemory,omitempty"`
// IdleCpuClass controls how unusded CPUs outside any a
// balloons are (re)configured.
IdleCpuClass string `json:"idleCPUClass",omitempty"`
IdleCpuClass string `json:"idleCPUClass,omitempty"`
// ReservedPoolNamespaces is a list of namespace globs that
// will be allocated to reserved CPUs.
ReservedPoolNamespaces []string `json:"reservedPoolNamespaces,omitempty"`
Expand Down Expand Up @@ -185,10 +185,12 @@ type BalloonDef struct {
ShareIdleCpusInSame CPUTopologyLevel `json:"shareIdleCPUsInSame,omitempty"`
// PreferCloseToDevices: prefer creating new balloons of this
// type close to listed devices.
PreferCloseToDevices []string `json:"preferCloseToDevices",omitempty`
PreferCloseToDevices []string `json:"preferCloseToDevices,omitempty"`
// PreferFarFromDevices: prefer creating new balloons of this
// type far from listed devices.
PreferFarFromDevices []string `json:"preferFarFromDevices",omitempty`
// TODO: PreferFarFromDevices is considered too untested for usage. Hence,
// for the time being we prevent its usage through CRDs.
PreferFarFromDevices []string `json:"-"`
}

// String stringifies a BalloonDef
Expand Down

0 comments on commit 1e1dad9

Please sign in to comment.