Altinity / Altinity/clickhouse-operator
Remove deprecated `OnePerHost` pod-distribution value
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:
- Go constant —
pkg/apis/deployment/affinity.go:55(PodDistributionOnePerHost = "OnePerHost"). - CRDs — drop
"OnePerHost"from thedistribution/podDistribution.typeenum in:deploy/operatorhub/<current-version>/clickhouseinstallations.clickhouse.altinity.com.crd.yamldeploy/operatorhub/<current-version>/clickhouseinstallationtemplates.clickhouse.altinity.com.crd.yamldeploy/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.
(Olderdeploy/operatorhub/0.x.y/directories are historical snapshots — leave those alone.)
- Docs —
docs/custom_resource_explained.mdlines 564–606 still listOnePerHostas a validdistributionvalue and show it in two examples. Replace with the supported equivalents (type: ClickHouseAntiAffinityortype: MaxNumberPerNode, number: 1). - Examples —
docs/chit-examples/104-templates.yamluses a top-leveldistribution: "OnePerHost"field that doesn't even exist onPodTemplatein the Go types. Rewrite usingpodDistribution:. - 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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