Skip to content

updated cloudnative dependency to 1.27.0#1693

Merged
dannyzaken merged 1 commit intonoobaa:masterfrom
dannyzaken:danny-cnpg-1.27
Sep 3, 2025
Merged

updated cloudnative dependency to 1.27.0#1693
dannyzaken merged 1 commit intonoobaa:masterfrom
dannyzaken:danny-cnpg-1.27

Conversation

@dannyzaken
Copy link
Member

@dannyzaken dannyzaken commented Sep 1, 2025

Explain the changes

  1. updated cloudnative dependency to 1.27.0
  2. fixed autoscaler.go compilation errors due to changes in Prometheus dependency

Gaps

  1. The default cnpg image is still set to 1.25.0. This is only used for development environments, and it functions as intended.
  2. We should build a new upstream image for the noobaa flavor of cnpg 1.27.0

Issues: Fixed #xxx / Gap #xxx

  1. https://issues.redhat.com/browse/DFBUGS-3830

Testing Instructions:

  • Doc added/updated
  • Tests added

Summary by CodeRabbit

  • New Features
    • Now expects 10 CRDs for the CloudNativePG CRD set.
  • Bug Fixes
    • Improved autoscaler Prometheus discovery reliability.
    • Adjusted reconcile retry behavior to avoid unintended immediate requeues across several controllers.
  • Documentation
    • Removed beta gate notes from NooBaa CRD field descriptions.
  • Chores
    • Upgraded CloudNativePG support to v1.27.0, bumped Go to 1.24.1, and performed a broad dependency refresh.

@coderabbitai
Copy link

coderabbitai bot commented Sep 1, 2025

Walkthrough

Bumps Go toolchain and many dependencies; increases expected CNPG CRD count from 9 to 10; updates exported CnpgVersion to 1.27.0; fixes autoscaler to return a Prometheus pointer; removes repeated beta-note text from NooBaa CRD descriptions and updates its embedded checksum; narrows RunReconcile requeue condition.

Changes

Cohort / File(s) Summary
Dependencies and toolchain
go.mod
Go version bumped to 1.24.1; extensive direct and indirect dependency upgrades, replacements, and constraint updates across Kubernetes libs, controller-runtime, gRPC/protobuf, Prometheus, OpenTelemetry, testing libs, and others. No source-code API changes.
CNPG CRD validation
pkg/cnpg/cnpg.go
Increased expected CRD count in getResourcesFromYaml from 9 to 10 (validation condition unchanged except for the expected value).
CNPG version option
pkg/options/options.go
Exported variable CnpgVersion value updated from "1.25.0" to "1.27.0" (declaration unchanged).
Autoscaler Prometheus retrieval
pkg/system/autoscaler.go
getPrometheus now returns a pointer to the first item (&prometheusList.Items[0]) instead of a value, matching the function signature.
Run loop retry behavior
pkg/system/system.go, pkg/backingstore/backingstore.go, pkg/bucketclass/bucketclass.go, pkg/namespacestore/namespacestore.go, pkg/noobaaaccount/noobaaaccount.go
RunReconcile retry condition tightened: previously requeued when `res.Requeue
NooBaa CRD docs & bundle checksum
deploy/crds/noobaa.io_noobaas.yaml, pkg/bundle/deploy.go
Removed repeated beta-feature sentence from matchLabelKeys / mismatchLabelKeys descriptions under podAffinity/podAntiAffinity; updated embedded YAML checksum constant Sha256_deploy_crds_noobaa_io_noobaas_yaml to reflect the changed YAML blob.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Autoscaler as Autoscaler
  participant K8sAPI as K8s API (client)
  note right of Autoscaler #D3E4FF: getPrometheus now returns a pointer
  Autoscaler->>K8sAPI: List Prometheus objects
  K8sAPI-->>Autoscaler: prometheusList (Items array)
  alt found
    Autoscaler->>Autoscaler: return &prometheusList.Items[0]
  else none
    Autoscaler-->>Autoscaler: return error
  end
Loading
sequenceDiagram
  autonumber
  participant Controller as Controller.RunReconcile
  participant Reconciler as Reconciler
  note right of Controller #FFF4D6: requeue condition tightened
  Controller->>Reconciler: call Reconcile()
  Reconciler-->>Controller: Result{Requeue, RequeueAfter}
  alt RequeueAfter != 0
    Controller->>Controller: schedule requeue after RequeueAfter
  else RequeueOnly (Requeue==true, RequeueAfter==0)
    Controller->>Controller: no requeue (changed)
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • nimrod-becker
  • liranmauda
  • naveenpaul1
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
pkg/system/autoscaler.go (2)

582-593: Fix: undefined ctx and premature polling termination in waitForCertificateReady.

  • ctx is not defined; this won’t compile.
  • Returning an error when the cert isn’t ready stops polling early.

Apply:

-	err := wait.PollUntilContextTimeout(ctx, interval*time.Second, timeout*time.Second, true, func(ctx context.Context) (bool, error) {
+	err := wait.PollUntilContextTimeout(context.Background(), interval*time.Second, timeout*time.Second, true, func(ctx context.Context) (bool, error) {
 		if err := klient.Get(util.Context(), util.ObjectKey(configMap), configMap); err != nil {
 			log.Printf("⏳ Failed to get service ca certificate: %s", err)
 			return false, nil
 		}
-		if configMap.Data["service-ca.crt"] == "" {
-			return false, fmt.Errorf("service ca certificate not created")
-		}
+		if strings.TrimSpace(configMap.Data["service-ca.crt"]) == "" {
+			return false, nil
+		}
 
 		return true, nil
 	})

63-69: Guard against empty Metrics slice before indexing.

Indexing at [0] can panic if Metrics is empty.

-		if r.AdapterHPA.Spec.Metrics[0].Type == autoscalingv2.ResourceMetricSourceType {
+		if len(r.AdapterHPA.Spec.Metrics) > 0 && r.AdapterHPA.Spec.Metrics[0].Type == autoscalingv2.ResourceMetricSourceType {
🧹 Nitpick comments (6)
pkg/system/autoscaler.go (3)

414-438: Verify service discovery: using ServiceAccountName as Service name looks incorrect.

getPrometheusURL constructs a Service with Name = Prometheus.Spec.ServiceAccountName. That field is a service account, not a Service. Please confirm a Service with that name actually exists in your target clusters; otherwise, resolve the Service by known labels/selectors or make the Service name configurable.

I can suggest a label-based lookup (and a fallback to a user-provided service name) if desired.


259-271: Tighten user-facing messages: multiple typos and wording issues.

These show up in logs/errors and degrade UX. Suggested fixes:

-	log.Errorf("❌  Keda deploymen not ready")
+	log.Errorf("❌  Keda deployment not ready")

-			log.Errorf("Falied to delete HPAV1 existing %q autoscaler", autoscalersName)
-			return fmt.Errorf("falied to delete HPAV1 existing %q autoscaler", autoscalersName)
+			log.Errorf("Failed to delete HPAV1 existing %q autoscaler", autoscalersName)
+			return fmt.Errorf("failed to delete HPAV1 existing %q autoscaler", autoscalersName)

-		log.Errorf("Falied to delete Keda existing %q autoscaler", autoscalersv2.Items[0].Name)
-		return fmt.Errorf("Falied to delete Keda existing %q autoscaler", autoscalersv2.Items[0].Name)
+		log.Errorf("Failed to delete Keda existing %q autoscaler", autoscalersv2.Items[0].Name)
+		return fmt.Errorf("failed to delete Keda existing %q autoscaler", autoscalersv2.Items[0].Name)

-			log.Errorf("falied to delete HPAV2 Resources : %s", err)
+			log.Errorf("failed to delete HPAV2 resources: %s", err)
-			log.Errorf("Falied to delete HPAV2 existing %q autoscaler", item.Name)
-			return fmt.Errorf("falied to delete HPAV2 existing %q autoscaler", item.Name)
+			log.Errorf("Failed to delete HPAV2 existing %q autoscaler", item.Name)
+			return fmt.Errorf("failed to delete HPAV2 existing %q autoscaler", item.Name)

-		log.Println("❌ Failed to find the promethues port")
-		return "", fmt.Errorf("Failed to find the promethues port")
+		log.Println("❌ Failed to find the prometheus port")
+		return "", fmt.Errorf("failed to find the prometheus port")

-		return fmt.Errorf("Error while crateiing APIService prometheus-adapter")
+		return fmt.Errorf("error while creating APIService prometheus-adapter")

-		return fmt.Errorf("Error while crateiing ClusterRole prometheus-adapter-resource-reader")
+		return fmt.Errorf("error while creating ClusterRole prometheus-adapter-resource-reader")
-		return fmt.Errorf("Error while crateiing ClusterRoleBinding prometheus-adapter-system-auth-delegator")
+		return fmt.Errorf("error while creating ClusterRoleBinding prometheus-adapter-system-auth-delegator")
-		return fmt.Errorf("Error while crateiing RoleBinding prometheus-adapter-auth-reader")
+		return fmt.Errorf("error while creating RoleBinding prometheus-adapter-auth-reader")
-		return fmt.Errorf("Error while crateiing ClusterRoleBinding prometheus-adapter-resource-reader")
+		return fmt.Errorf("error while creating ClusterRoleBinding prometheus-adapter-resource-reader")

Optional: rename promethesNamespace → prometheusNamespace throughout for consistency.

Also applies to: 111-113, 133-135, 165-167, 433-435, 506-507, 542-563


357-365: Optional: narrow Prometheus selection.

KubeList without a selector may pick an arbitrary Prometheus if multiple exist in the namespace. Consider filtering by labels or name to avoid ambiguity.

pkg/options/options.go (1)

182-184: Image/version mismatch: deploying 1.25.0 image with 1.27.0 manifests.

This can drift behavior and APIs. If keeping 1.25.0 temporarily is intentional, add a TODO and track follow-up to switch to 1.27.0 when the noobaa-flavored image is published.

-var CnpgImage = "quay.io/noobaa/cloudnative-pg-noobaa:v1.25.0"
+// TODO(DFBUGS-3830): bump to v1.27.0 once the noobaa-flavored image is built and published
+var CnpgImage = "quay.io/noobaa/cloudnative-pg-noobaa:v1.25.0"
pkg/cnpg/cnpg.go (2)

548-551: Hard-coding CRD count is brittle; prefer validating required CRD names.

Upstream may add/remove CRDs across minors/patches. Instead of exact count, verify presence of the specific CRDs you require and warn on extras.

I can provide a helper that checks a set of required CRD names and reports which are missing/unexpected.


427-438: Nit: variable typo (mofifiedManifestBytes).

Rename to modifiedManifestBytes for readability.

-	mofifiedManifestBytes := bytes.ReplaceAll(manifestBytes,
+	modifiedManifestBytes := bytes.ReplaceAll(manifestBytes,
 		[]byte(originalGroup),
 		[]byte(noobaaGroupDomain))
...
-	mofifiedManifestBytes = bytes.ReplaceAll(mofifiedManifestBytes,
+	modifiedManifestBytes = bytes.ReplaceAll(modifiedManifestBytes,
 		[]byte(originalPath),
 		[]byte(newPath))
...
-	return mofifiedManifestBytes
+	return modifiedManifestBytes
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between f43cb97 and 3c69ccf.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (4)
  • go.mod (7 hunks)
  • pkg/cnpg/cnpg.go (1 hunks)
  • pkg/options/options.go (1 hunks)
  • pkg/system/autoscaler.go (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (13)
  • GitHub Check: run-operator-tests
  • GitHub Check: run-kms-dev-test
  • GitHub Check: run-core-config-map-tests
  • GitHub Check: run-kms-key-rotate-test
  • GitHub Check: run-cli-tests
  • GitHub Check: cnpg-deployment-test
  • GitHub Check: run-kms-tls-token-test
  • GitHub Check: run-kms-kmip-test
  • GitHub Check: run-hac-test
  • GitHub Check: run-azure-vault-test
  • GitHub Check: golangci-lint
  • GitHub Check: run-admission-test
  • GitHub Check: run-kms-tls-sa-test
🔇 Additional comments (3)
pkg/system/autoscaler.go (1)

366-366: Pointer return from getPrometheus is correct.

Returning a pointer aligns with downstream signatures and avoids unnecessary struct copies. LGTM.

pkg/options/options.go (1)

180-180: Version bump to 1.27.0 looks good.

Matches the dependency upgrade in go.mod and CRD count change.

go.mod (1)

39-39: Prometheus operator bump aligns with autoscaler fixes.

No action needed; just flagging that dependent API changes likely motivated the pointer return from getPrometheus.

module github.com/noobaa/noobaa-operator/v5

go 1.24
go 1.24.1
Copy link

@coderabbitai coderabbitai bot Sep 1, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix go directive: patch versions aren’t allowed here.

go.mod’s go line must be major.minor only. Use go 1.24 and optionally add a separate toolchain line for go1.24.1.

-go 1.24.1
+go 1.24
+toolchain go1.24.1
📝 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
go 1.24.1
go 1.24
toolchain go1.24.1
🤖 Prompt for AI Agents
In go.mod around lines 3 to 3, the go directive currently specifies a patch
version ("go 1.24.1") which is invalid; change it to the major.minor form "go
1.24" and if you need to pin the exact toolchain add a separate "toolchain"
directive (e.g., "toolchain go1.24.1") instead of using a patch in the go line.

Copy link
Contributor

Choose a reason for hiding this comment

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

@dannyzaken
The directive of the go version should only point to y stream
The toolchain will point to a specific z

Copy link

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll check it. I think it was set automatically by go.

Copy link
Member Author

Choose a reason for hiding this comment

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

@dannyzaken The directive of the go version should only point to y stream The toolchain will point to a specific z

@liranmauda Are you sure about that? the go version is updated automatically to 1.24.1 by go mod tidy.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

♻️ Duplicate comments (1)
go.mod (1)

3-3: Fix go directive: patch versions aren’t allowed.

Use major.minor only and add a separate toolchain pin.

-go 1.24.1
+go 1.24
+toolchain go1.24.1
🧹 Nitpick comments (1)
go.mod (1)

90-90: Prefer a tagged release over a pseudo-version for gorilla/websocket.

Use a stable tag (e.g., v1.5.4) for reproducibility unless you specifically need that commit.

-	github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
+	github.com/gorilla/websocket v1.5.4 // indirect
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 3c69ccf and 58b8a26.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (5)
  • deploy/crds/noobaa.io_noobaas.yaml (0 hunks)
  • go.mod (7 hunks)
  • pkg/cnpg/cnpg.go (1 hunks)
  • pkg/options/options.go (1 hunks)
  • pkg/system/autoscaler.go (1 hunks)
💤 Files with no reviewable changes (1)
  • deploy/crds/noobaa.io_noobaas.yaml
🚧 Files skipped from review as they are similar to previous changes (3)
  • pkg/options/options.go
  • pkg/cnpg/cnpg.go
  • pkg/system/autoscaler.go
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-06-25T15:42:04.436Z
Learnt from: Neon-White
PR: noobaa/noobaa-operator#1637
File: Makefile:193-203
Timestamp: 2025-06-25T15:42:04.436Z
Learning: golangci-lint v2.x versions output the version with a leading "v" prefix (e.g., "golangci-lint has version v2.1.6..."), while v1.x versions output without the "v" prefix (e.g., "golangci-lint has version 1.64.8..."). Version detection logic should account for the specific version format being targeted.

Applied to files:

  • go.mod
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (13)
  • GitHub Check: cnpg-deployment-test
  • GitHub Check: run-core-config-map-tests
  • GitHub Check: run-cli-tests
  • GitHub Check: run-azure-vault-test
  • GitHub Check: run-kms-tls-token-test
  • GitHub Check: run-kms-kmip-test
  • GitHub Check: golangci-lint
  • GitHub Check: run-operator-tests
  • GitHub Check: run-kms-tls-sa-test
  • GitHub Check: run-admission-test
  • GitHub Check: run-kms-dev-test
  • GitHub Check: run-hac-test
  • GitHub Check: run-kms-key-rotate-test
🔇 Additional comments (1)
go.mod (1)

210-212: Compatibility check passed; no changes required.

gRPC (v1.74.2), protobuf (v1.36.7) and genproto submodules (v0.0.0-20250528174236-200df99c418a) align with their upstream requirements.

Comment on lines +49 to 55
k8s.io/api v0.33.3
k8s.io/apiextensions-apiserver v0.33.3
k8s.io/apimachinery v0.33.3
k8s.io/cli-runtime v0.33.3
k8s.io/client-go v0.33.3
k8s.io/code-generator v0.33.3
k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Verify k8s library set is version-aligned with controller-runtime.

You’ve bumped core k8s libs to v0.33.3 and controller-runtime to v0.21.0. Ensure this matches the ctrl-runtime/k8s compatibility matrix to avoid subtle API/serializer mismatches.

Also applies to: 59-59, 64-64


🏁 Script executed:

#!/bin/bash
# List k8s.* and controller-runtime versions to spot strays
go list -m -json all | jq -r '
  select(.Path|test("^(k8s.io/|sigs.k8s.io/controller-runtime$)")) 
  | "\(.Path) \(.Version)"
' | sort

# Show any mixed k8s minors (expect all 0.33.x except known exceptions like kube-aggregator/kubectl you intentionally keep older)
go list -m -json all | jq -r '
  select(.Path|startswith("k8s.io/") and (.Path|test("^(k8s.io/(gengo|kube-openapi))")==false)) 
  | .Version
' | sed -nE 's/^v0\.([0-9]+)\..*/\1/p' | sort -u

Length of output: 2357


Align k8s module minors

  • k8s.io/component-helpers (v0.25.4) and k8s.io/metrics (v0.25.4) remain on older minors while core libs are at v0.33.3—bump them to v0.33.3 or explicitly document them as intentional exceptions.
  • Verify sigs.k8s.io/controller-runtime v0.21.0 is compatible with k8s v0.33.x per the official compatibility matrix.
🤖 Prompt for AI Agents
In go.mod around lines 49–55, k8s.io/component-helpers and k8s.io/metrics are
left at older minor versions while core k8s libs are at v0.33.3; bump those
modules to v0.33.3 (or add a comment explaining the intentional exception), then
verify sigs.k8s.io/controller-runtime v0.21.0 compatibility with Kubernetes
v0.33.x per the official compatibility matrix and upgrade/downgrade
controller-runtime to a compatible release if needed; after changing versions
run go mod tidy and full build/test to ensure no dependency or API breakages.

@dannyzaken dannyzaken force-pushed the danny-cnpg-1.27 branch 2 times, most recently from a40724d to f3b3aad Compare September 1, 2025 16:16
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
pkg/system/system.go (2)

895-900: Don’t ignore res.Requeue; current loop may exit prematurely.

Reconciler requests with Requeue==true (and zero RequeueAfter) will now be treated as “done,” potentially stopping before the system stabilizes.

Apply:

-        if res.RequeueAfter != 0 {
-            log.Printf("\nRetrying in %d seconds\n", interval)
-            return false, nil
-        }
+        if res.Requeue || res.RequeueAfter > 0 {
+            if res.RequeueAfter > 0 {
+                log.Printf("\nRetrying in %s\n", res.RequeueAfter)
+            } else {
+                log.Printf("\nRetrying immediately\n")
+            }
+            return false, nil
+        }

680-683: Wrong field used for desired image.

When sys.Spec.Image != nil, this assigns DBImage instead of Image.

-    } else if sys.Spec.Image != nil {
-        desiredImage = *sys.Spec.DBImage
+    } else if sys.Spec.Image != nil {
+        desiredImage = *sys.Spec.Image
♻️ Duplicate comments (2)
go.mod (2)

3-3: Fix go directive: patch versions aren’t allowed.

Use major.minor and add a toolchain line.

-go 1.24.1
+go 1.24
+toolchain go1.24.1

49-59: Verify k8s/controller-runtime minor alignment and older module pins.

You’ve got k8s v0.33.x with controller-runtime v0.21.0 alongside older kube-aggregator v0.27.1 and kubectl v0.25.4. Please confirm compatibility or bump/pin intentionally.

Run:

#!/bin/bash
# Show controller-runtime and k8s minors
go list -m -json all | jq -r '
  select(.Path=="sigs.k8s.io/controller-runtime" or (.Path|startswith("k8s.io/")))
  | "\(.Path) \(.Version)"
' | sort

Also applies to: 64-64

🧹 Nitpick comments (2)
pkg/cnpg/cnpg.go (2)

548-551: Avoid fragile CRD hard-count; tolerate additions while guarding against missing core CRDs.

Pinning to an exact count breaks on upstream adding CRDs. Require a minimum and allow extras.

-    expectedNumberOfCrds := 10
-    if len(cnpgRes.CRDs) != expectedNumberOfCrds {
-        return nil, fmt.Errorf("expected %d CustomResourceDefinitions, got %d", expectedNumberOfCrds, len(cnpgRes.CRDs))
-    }
+    const minExpectedCRDs = 10
+    if len(cnpgRes.CRDs) < minExpectedCRDs {
+        return nil, fmt.Errorf("expected at least %d CustomResourceDefinitions for CNPG %s, got %d",
+            minExpectedCRDs, options.CnpgVersion, len(cnpgRes.CRDs))
+    }

427-439: Typo: “mofifiedManifestBytes” → “modifiedManifestBytes”.

Minor readability fix.

-    mofifiedManifestBytes := bytes.ReplaceAll(manifestBytes,
+    modifiedManifestBytes := bytes.ReplaceAll(manifestBytes,
         []byte(originalGroup),
         []byte(noobaaGroupDomain))
 ...
-    mofifiedManifestBytes = bytes.ReplaceAll(mofifiedManifestBytes,
+    modifiedManifestBytes = bytes.ReplaceAll(modifiedManifestBytes,
         []byte(originalPath),
         []byte(newPath))
 
-    return mofifiedManifestBytes
+    return modifiedManifestBytes
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between a40724d and f3b3aad.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (7)
  • deploy/crds/noobaa.io_noobaas.yaml (0 hunks)
  • go.mod (7 hunks)
  • pkg/bundle/deploy.go (1 hunks)
  • pkg/cnpg/cnpg.go (1 hunks)
  • pkg/options/options.go (1 hunks)
  • pkg/system/autoscaler.go (1 hunks)
  • pkg/system/system.go (1 hunks)
💤 Files with no reviewable changes (1)
  • deploy/crds/noobaa.io_noobaas.yaml
🚧 Files skipped from review as they are similar to previous changes (3)
  • pkg/options/options.go
  • pkg/system/autoscaler.go
  • pkg/bundle/deploy.go
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-06-25T15:42:04.436Z
Learnt from: Neon-White
PR: noobaa/noobaa-operator#1637
File: Makefile:193-203
Timestamp: 2025-06-25T15:42:04.436Z
Learning: golangci-lint v2.x versions output the version with a leading "v" prefix (e.g., "golangci-lint has version v2.1.6..."), while v1.x versions output without the "v" prefix (e.g., "golangci-lint has version 1.64.8..."). Version detection logic should account for the specific version format being targeted.

Applied to files:

  • go.mod
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
  • GitHub Check: cnpg-deployment-test
  • GitHub Check: run-core-config-map-tests
  • GitHub Check: run-cli-tests
  • GitHub Check: run-kms-tls-sa-test
  • GitHub Check: run-kms-tls-token-test
  • GitHub Check: run-kms-kmip-test
  • GitHub Check: run-operator-tests
  • GitHub Check: run-kms-key-rotate-test
  • GitHub Check: run-admission-test
  • GitHub Check: run-azure-vault-test
  • GitHub Check: run-hac-test
  • GitHub Check: run-kms-dev-test

Signed-off-by: Danny Zaken <dannyzaken@gmail.com>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (2)
go.mod (2)

49-55: Verify ctrl-runtime/k8s minor compatibility

controller-runtime v0.21.0 with k8s v0.33.3 should match the official matrix; please double-check to avoid subtle API/serializer issues.

Also applies to: 64-64


3-3: Fix go directive: patch versions aren’t allowed

Use major.minor and add a separate toolchain pin.

-go 1.24.1
+go 1.24
+toolchain go1.24.1
🧹 Nitpick comments (4)
pkg/noobaaaccount/noobaaaccount.go (1)

668-671: Reconcile loop now ignores res.Requeue; verify no callers rely on it

If any reconciler returns Requeue=true without RequeueAfter, this loop will prematurely stop. Either confirm that never happens or reintroduce the Requeue check.

Also fix the retry log to show actual durations:

-    if res.RequeueAfter != 0 {
-        log.Printf("\nRetrying in %d seconds\n", interval)
-        return false, nil
-    }
+    if res.RequeueAfter != 0 {
+        log.Printf("\nController requested requeue after %s; CLI poll interval is %s\n",
+            res.RequeueAfter.Round(time.Second), interval*time.Second)
+        return false, nil
+    }
pkg/backingstore/backingstore.go (1)

1054-1057: Behavior change: only RequeueAfter triggers retry

Dropping res.Requeue can exit early if a reconciler sets only Requeue=true. Please verify upstream reconcilers or keep the fallback.

Improve the retry log to reflect real timing:

-    if res.RequeueAfter != 0 {
-        log.Printf("\nRetrying in %d seconds\n", interval)
-        return false, nil
-    }
+    if res.RequeueAfter != 0 {
+        log.Printf("\nController requested requeue after %s; CLI poll interval is %s\n",
+            res.RequeueAfter.Round(time.Second), interval*time.Second)
+        return false, nil
+    }
pkg/bucketclass/bucketclass.go (1)

578-581: Retry condition narrowed; confirm no plain Requeue usages remain

Exiting when RequeueAfter==0 ignores Requeue=true. Validate callers or restore the Requeue check.

Tweak the log for accurate duration output:

-    if res.RequeueAfter != 0 {
-        log.Printf("\nRetrying in %d seconds\n", interval)
-        return false, nil
-    }
+    if res.RequeueAfter != 0 {
+        log.Printf("\nController requested requeue after %s; CLI poll interval is %s\n",
+            res.RequeueAfter.Round(time.Second), interval*time.Second)
+        return false, nil
+    }
go.mod (1)

21-21: CNPG 1.27.0 bump: align images/CRDs and docs

Since module is now v1.27.0, ensure:

  • default CNPG image tag is updated (still 1.25.0 per PR notes),
  • noobaa-flavor 1.27.0 image is built/pushed,
  • CRD count/validation and docs reflect 1.27.0.

Happy to draft a follow-up PR/issue checklist for the image build and doc updates.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between f3b3aad and 3bd3be9.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (11)
  • deploy/crds/noobaa.io_noobaas.yaml (0 hunks)
  • go.mod (7 hunks)
  • pkg/backingstore/backingstore.go (1 hunks)
  • pkg/bucketclass/bucketclass.go (1 hunks)
  • pkg/bundle/deploy.go (1 hunks)
  • pkg/cnpg/cnpg.go (1 hunks)
  • pkg/namespacestore/namespacestore.go (1 hunks)
  • pkg/noobaaaccount/noobaaaccount.go (1 hunks)
  • pkg/options/options.go (1 hunks)
  • pkg/system/autoscaler.go (1 hunks)
  • pkg/system/system.go (1 hunks)
💤 Files with no reviewable changes (1)
  • deploy/crds/noobaa.io_noobaas.yaml
🚧 Files skipped from review as they are similar to previous changes (5)
  • pkg/cnpg/cnpg.go
  • pkg/system/autoscaler.go
  • pkg/bundle/deploy.go
  • pkg/system/system.go
  • pkg/options/options.go
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-06-25T15:42:04.436Z
Learnt from: Neon-White
PR: noobaa/noobaa-operator#1637
File: Makefile:193-203
Timestamp: 2025-06-25T15:42:04.436Z
Learning: golangci-lint v2.x versions output the version with a leading "v" prefix (e.g., "golangci-lint has version v2.1.6..."), while v1.x versions output without the "v" prefix (e.g., "golangci-lint has version 1.64.8..."). Version detection logic should account for the specific version format being targeted.

Applied to files:

  • go.mod
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (13)
  • GitHub Check: run-admission-test
  • GitHub Check: run-core-config-map-tests
  • GitHub Check: golangci-lint
  • GitHub Check: cnpg-deployment-test
  • GitHub Check: run-kms-tls-token-test
  • GitHub Check: run-hac-test
  • GitHub Check: run-kms-key-rotate-test
  • GitHub Check: run-kms-kmip-test
  • GitHub Check: run-kms-tls-sa-test
  • GitHub Check: run-kms-dev-test
  • GitHub Check: run-operator-tests
  • GitHub Check: run-cli-tests
  • GitHub Check: run-azure-vault-test
🔇 Additional comments (1)
pkg/namespacestore/namespacestore.go (1)

889-893: Verify Requeue fallback and improve log output

  • No occurrences of plain Requeue: true found—ensure no reconciler relies solely on Requeue or restore a fallback for {Requeue:true, RequeueAfter:0}.

  • Optional: format durations with %s for clarity:

     if res.RequeueAfter != 0 {
  •   log.Printf("\nRetrying in %d seconds\n", interval)
    
  •   log.Printf("\nController requested requeue after %s; CLI poll interval is %s\n",
    
  •       res.RequeueAfter.Round(time.Second), interval*time.Second)
       return false, nil
    
    }
    
    

@dannyzaken dannyzaken merged commit 09ba402 into noobaa:master Sep 3, 2025
16 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants