Skip to content

fix: Update-images - #310

Merged
collinol merged 1 commit into
mainfrom
fix(dev)-update-images
Aug 3, 2026
Merged

fix: Update-images#310
collinol merged 1 commit into
mainfrom
fix(dev)-update-images

Conversation

@collinol

@collinol collinol commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Missed hardcoded clickhouse-keeper image when moving image refs to manifest

Summary by CodeRabbit

  • New Features

    • ClickHouse Keeper now honors the Keeper container image defined in the server manifest, including custom registry and tag/version.
    • If the manifest omits the image, the standard default Keeper image is used.
  • Bug Fixes

    • Ensured manifest-based Keeper image settings are propagated correctly through deployment state handling.
  • Tests

    • Updated and added tests to verify manifest image selection (including registry override), default fallback behavior, and OpenShift deployments.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

ClickHouse Keeper image selection now uses server manifest values and the operator’s global registry, with a fallback image for older manifests. Manifest fixtures, reconciliation wiring, and Keeper vendor spec tests were updated accordingly.

Changes

ClickHouse Keeper image resolution

Layer / File(s) Summary
Manifest image defaults
hack/testing-manifests/server-manifest/0.83.0-clickhouse-keeper.*/manifest.yaml, internal/controller/infra/managed/clickhouse/altinity/keeper/values.go
Keeper manifest fixtures now specify the container image, while the pinned fallback is renamed to defaultKeeperImage.
Keeper spec image integration
internal/controller/infra/managed/clickhouse/altinity/keeper/spec.go, internal/controller/reconciler/clickhouse.go, internal/controller/infra/managed/clickhouse/altinity/keeper/spec_test.go
ToKeeperVendorSpec receives the server manifest, resolves the Keeper image with the global registry or fallback, and tests cover manifest-provided and default images.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: amwarrier, danielpanzella, casey-coreweave

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is related to the change, but "Update-images" is too vague to convey the specific ClickHouse Keeper manifest update. Rename it to clearly describe the main change, such as updating the ClickHouse Keeper image source to use the manifest.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix(dev)-update-images

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@collinol
collinol marked this pull request as ready for review July 29, 2026 22:05
@collinol
collinol requested a review from a team as a code owner July 29, 2026 22:05

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/controller/infra/managed/clickhouse/altinity/keeper/spec_test.go`:
- Line 52: Update the assertion in the relevant keeper spec test to compare
container.Image against defaultKeeperImage (or the explicit expected fallback
value) instead of calling KeeperImage, ensuring the test independently validates
fallback wiring.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: fa0f273c-495d-4ef4-a9e5-b54b003f245d

📥 Commits

Reviewing files that changed from the base of the PR and between 2ddcad0 and 997322c.

📒 Files selected for processing (6)
  • hack/testing-manifests/server-manifest/0.83.0-clickhouse-keeper.1/manifest.yaml
  • hack/testing-manifests/server-manifest/0.83.0-clickhouse-keeper.2/manifest.yaml
  • internal/controller/infra/managed/clickhouse/altinity/keeper/spec.go
  • internal/controller/infra/managed/clickhouse/altinity/keeper/spec_test.go
  • internal/controller/infra/managed/clickhouse/altinity/keeper/values.go
  • internal/controller/reconciler/clickhouse.go

Expect(chk.Spec.Templates.PodTemplates).To(HaveLen(1))
container := chk.Spec.Templates.PodTemplates[0].Spec.Containers[0]
Expect(container.Image).To(Equal(KeeperImage))
Expect(container.Image).To(Equal(KeeperImage(manifest.ImageRef{}, "")))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Assert the fallback independently of the implementation helper.

The production value and expected value both call KeeperImage, so this test cannot detect incorrect fallback wiring. Compare against defaultKeeperImage (or an explicit contract value) instead.

Proposed fix
-		Expect(container.Image).To(Equal(KeeperImage(manifest.ImageRef{}, "")))
+		Expect(container.Image).To(Equal(defaultKeeperImage))
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Expect(container.Image).To(Equal(KeeperImage(manifest.ImageRef{}, "")))
Expect(container.Image).To(Equal(defaultKeeperImage))
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/controller/infra/managed/clickhouse/altinity/keeper/spec_test.go` at
line 52, Update the assertion in the relevant keeper spec test to compare
container.Image against defaultKeeperImage (or the explicit expected fallback
value) instead of calling KeeperImage, ensuring the test independently validates
fallback wiring.

@collinol collinol changed the title fix(dev)-update-images fix: Update-images Jul 30, 2026
@collinol
collinol force-pushed the fix(dev)-update-images branch from 997322c to 5c31ca2 Compare July 30, 2026 21:03

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/controller/infra/managed/clickhouse/altinity/keeper/spec.go`:
- Around line 23-29: Update KeeperImage to detect an empty manifest image
repository before calling img.GetImage, then return defaultKeeperImage with the
configured global registry prefix applied; preserve the existing GetImage result
for non-empty images. Add a regression test covering manifest.ImageRef{} with a
non-empty global registry and verifying the correctly prefixed fallback image.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c84eccee-154f-42fd-803a-c9ca4c98b772

📥 Commits

Reviewing files that changed from the base of the PR and between 997322c and 5c31ca2.

📒 Files selected for processing (6)
  • hack/testing-manifests/server-manifest/0.83.0-clickhouse-keeper.1/manifest.yaml
  • hack/testing-manifests/server-manifest/0.83.0-clickhouse-keeper.2/manifest.yaml
  • internal/controller/infra/managed/clickhouse/altinity/keeper/spec.go
  • internal/controller/infra/managed/clickhouse/altinity/keeper/spec_test.go
  • internal/controller/infra/managed/clickhouse/altinity/keeper/values.go
  • internal/controller/reconciler/clickhouse.go

Comment on lines +23 to +29
func KeeperImage(img manifest.ImageRef, globalImageRegistry string) string {
if out := img.GetImage(globalImageRegistry); out != "" {
return out
}
// Fallback for older manifests that don't supply the image.
return defaultKeeperImage
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Preserve the fallback when a global registry is configured.

For an older manifest, manifest.ImageRef{} passed to GetImage("myregistry.io") returns "myregistry.io/", so out != "" skips the fallback and produces an invalid image. Even after fixing detection, returning defaultKeeperImage directly would bypass the global registry.

Detect an empty repository before calling GetImage, then apply the same global-registry prefix to the fallback and add a regression test for an empty image with a non-empty global registry.

Proposed fix
 func KeeperImage(img manifest.ImageRef, globalImageRegistry string) string {
+	if img.Repository == "" {
+		return (manifest.ImageRef{Repository: defaultKeeperImage}).GetImage(globalImageRegistry)
+	}
 	if out := img.GetImage(globalImageRegistry); out != "" {
 		return out
 	}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
func KeeperImage(img manifest.ImageRef, globalImageRegistry string) string {
if out := img.GetImage(globalImageRegistry); out != "" {
return out
}
// Fallback for older manifests that don't supply the image.
return defaultKeeperImage
}
func KeeperImage(img manifest.ImageRef, globalImageRegistry string) string {
if img.Repository == "" {
return (manifest.ImageRef{Repository: defaultKeeperImage}).GetImage(globalImageRegistry)
}
if out := img.GetImage(globalImageRegistry); out != "" {
return out
}
// Fallback for older manifests that don't supply the image.
return defaultKeeperImage
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/controller/infra/managed/clickhouse/altinity/keeper/spec.go` around
lines 23 - 29, Update KeeperImage to detect an empty manifest image repository
before calling img.GetImage, then return defaultKeeperImage with the configured
global registry prefix applied; preserve the existing GetImage result for
non-empty images. Add a regression test covering manifest.ImageRef{} with a
non-empty global registry and verifying the correctly prefixed fallback image.

@collinol
collinol merged commit db6e8d9 into main Aug 3, 2026
10 of 11 checks passed
@collinol
collinol deleted the fix(dev)-update-images branch August 3, 2026 16:47
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