Skip to content

Helm charts: fix YAML types for nodeSelector/affinity and add schema validation #668

Description

@cmcantalupo

Problem

Several Helm chart values across the repo use incorrect YAML types that could cause invalid manifest rendering if users override them with non-empty values.

Affected charts (at minimum): memory-qos, sgx-epc, memtierd, resctrl-mon.

1. nodeSelector and affinity default to [] (list) instead of {} (map)

In values.yaml:

affinity: []
nodeSelector: []

Kubernetes expects nodeSelector to be a map[string]string and affinity to be an object. While the {{- with }} template construct treats empty lists as falsy (so defaults don't render), the declared type is semantically wrong. Users copying the pattern could supply a list value by mistake.

2. values.schema.json is missing tolerations, affinity, and nodeSelector properties

The schema validates image, resources, nri, and podPriorityClassNodeCritical but does not describe scheduling-related values. Adding these with correct types (tolerations: array of objects, affinity: object, nodeSelector: object) would catch invalid user inputs at helm install time.

3. Chart.yaml uses version: v0.0.0 with a leading v

Helm requires SemVer for the version field. The leading v is technically non-compliant and rejected by strict helm lint/helm package. All charts use this pattern and should be updated to 0.0.0 (or an appropriate version).

Suggested fix

A single PR could update all affected charts consistently:

  • Change affinity: []affinity: {} and nodeSelector: []nodeSelector: {} in all values.yaml files
  • Add tolerations, affinity, nodeSelector to all values.schema.json files with correct types
  • Change version: v0.0.0version: 0.0.0 in all Chart.yaml files

Context

Discovered via automated code review (Copilot) on #666. These are pre-existing repo-wide patterns, not regressions introduced by that PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions