Altinity / Altinity/clickhouse-operator

Remove deprecated `OnePerHost` pod-distribution value

Open
#1,978 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
2.6k
Forks
574
Avg merge
8d 6h
Merged PRs (30d)
6

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the deprecated constant at pkg/apis/deployment/affinity.go:55 and inspect the listed affinity files, then trace how the CRDs under deploy/builder/, deploy/helm/, deploy/operator/ and current operatorhub manifests are generated. Update the supported values in the Go types, regenerated CRDs, docs/custom_resource_explained.md, docs/chit-examples/104-templates.yaml, and tests/requirements/requirements.md. Done means no current supported definition or example presents OnePerHost, while historical snapshots remain unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
devops, documentation
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.