Skip to content

Remove deprecated OnePerHost pod-distribution value #1978

@filimonov

Description

@filimonov

The OnePerHost pod-distribution value is dead code: the constant is marked // Deprecated value at pkg/apis/deployment/affinity.go:55, and no switch in pkg/model/common/affinity/pod-anti-affinity.go or pkg/model/common/normalizer/templates/pod.go matches it. A user-supplied OnePerHost is silently normalized to Unspecified and produces no affinity rules — i.e. it looks like it works but does nothing.

It should be cleaned out of:

  1. Go constantpkg/apis/deployment/affinity.go:55 (PodDistributionOnePerHost = "OnePerHost").
  2. CRDs — drop "OnePerHost" from the distribution/podDistribution.type enum in:
    • deploy/operatorhub/<current-version>/clickhouseinstallations.clickhouse.altinity.com.crd.yaml
    • deploy/operatorhub/<current-version>/clickhouseinstallationtemplates.clickhouse.altinity.com.crd.yaml
    • deploy/operatorhub/<current-version>/clickhousekeeperinstallations.clickhouse-keeper.altinity.com.crd.yaml
    • any matching CRDs under deploy/builder/, deploy/helm/, deploy/operator/ that the build pipeline regenerates.
      (Older deploy/operatorhub/0.x.y/ directories are historical snapshots — leave those alone.)
  3. Docsdocs/custom_resource_explained.md lines 564–606 still list OnePerHost as a valid distribution value and show it in two examples. Replace with the supported equivalents (type: ClickHouseAntiAffinity or type: MaxNumberPerNode, number: 1).
  4. Examplesdocs/chit-examples/104-templates.yaml uses a top-level distribution: "OnePerHost" field that doesn't even exist on PodTemplate in the Go types. Rewrite using podDistribution:.
  5. Requirements — mention in tests/requirements/requirements.md:1016.

Compatibility note

Removing the enum value is technically a breaking CRD change for any user who literally wrote OnePerHost. Since the value already does nothing, the user impact is just a validation error instead of silent no-op — arguably an improvement, but worth calling out in the release notes.

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