Skip to content

fix: set Healthy/Ready to Unknown if pods are running, but can't operator can't connect server#186

Merged
GrigoryPervakov merged 1 commit into
mainfrom
condition-fix
May 12, 2026
Merged

fix: set Healthy/Ready to Unknown if pods are running, but can't operator can't connect server#186
GrigoryPervakov merged 1 commit into
mainfrom
condition-fix

Conversation

@GrigoryPervakov
Copy link
Copy Markdown
Member

Why

If the version probe job is not ready or the external secret is missing, but server pods are running.
The operator can't connect the nodes and wrongly reports it as not healthy.

What

Set relevant conditions to the unknown in this case

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts ClickHouseCluster condition reporting so the operator doesn’t incorrectly mark clusters as unhealthy/not-ready when ClickHouse pods are running but the operator cannot probe them (e.g., version probe pending or required secret missing), by reporting Unknown instead.

Changes:

  • Update replica condition evaluation to set Healthy and Ready to Unknown when commander is not initialized.
  • Update controller tests to assert ClusterNotReady events only after prerequisites are met and readiness can be evaluated.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
internal/controller/clickhouse/sync.go Sets Healthy/Ready to Unknown when probing is impossible due to missing commander.
internal/controller/clickhouse/controller_test.go Reorders/updates event assertions to match the new condition transition behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/controller/clickhouse/sync.go Outdated
@GrigoryPervakov GrigoryPervakov marked this pull request as ready for review May 12, 2026 13:14
@GrigoryPervakov GrigoryPervakov enabled auto-merge (squash) May 12, 2026 13:14
@GrigoryPervakov GrigoryPervakov merged commit ebddd1f into main May 12, 2026
18 checks passed
@GrigoryPervakov GrigoryPervakov deleted the condition-fix branch May 12, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants