Skip to content

Conversation

anisurrahman75
Copy link

@anisurrahman75 anisurrahman75 commented Aug 26, 2025

Testing Instructions:

  1. Install NooBaa with an externally managed PostgreSQL DB
  2. noobaa install --postgres-url=''

Summary by CodeRabbit

  • New Features

    • Adds a configurable POSTGRES connection-string environment variable for core and endpoint; it is set only when an external PostgreSQL secret is provided.
  • Bug Fixes / Chores

    • Removes a hard-coded DB host so deployments can supply DB settings dynamically.
    • Updates deployment manifests and packaging to support the new behavior.
    • .gitignore updated to ignore IDE config files.

Copy link

coderabbitai bot commented Aug 26, 2025

Walkthrough

Adds POSTGRES_CONNECTION_STRING_PATH to internal deployment and statefulset manifests and updates their embedded SHA256s; setDesiredCoreEnv now assigns that env var only when ExternalPgSecret is present; .idea/ was added to .gitignore. (≤50 words)

Changes

Cohort / File(s) Summary
K8s internal manifests
deploy/internal/deployment-endpoint.yaml
Added environment variable POSTGRES_CONNECTION_STRING_PATH to the endpoint container env list (inserted after POSTGRES_PORT_PATH); entry added with no value/valueFrom (empty env var).
K8s internal manifests
deploy/internal/statefulset-core.yaml
Added environment variable POSTGRES_CONNECTION_STRING_PATH to the CORE container env block (placed after POSTGRES_PORT_PATH) and removed the hard-coded POSTGRES_HOST value.
Embedded manifests / bundle
pkg/bundle/deploy.go
Updated embedded YAML content and SHA256 constants for deploy/internal/deployment-endpoint.yaml and deploy/internal/statefulset-core.yaml to reflect the manifest changes.
Runtime behavior
pkg/system/phase2_creating.go
setDesiredCoreEnv now assigns POSTGRES_CONNECTION_STRING_PATH = /etc/postgres-secret/db_url only if r.NooBaa.Spec.ExternalPgSecret != nil; otherwise it leaves the env var unset.
Repo ignore rules
.gitignore
Appended .idea/ to ignore patterns.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Reconciler
  participant setDesiredCoreEnv
  participant NooBaaSpec

  Reconciler->>setDesiredCoreEnv: request CORE env setup
  setDesiredCoreEnv->>NooBaaSpec: check ExternalPgSecret
  alt ExternalPgSecret present
    note right of setDesiredCoreEnv #D6EAF8: assign DB URL to POSTGRES_CONNECTION_STRING_PATH
    setDesiredCoreEnv-->>Reconciler: POSTGRES_CONNECTION_STRING_PATH="/etc/postgres-secret/db_url"
  else ExternalPgSecret absent
    note right of setDesiredCoreEnv #FDEBD0: leave POSTGRES_CONNECTION_STRING_PATH unset
    setDesiredCoreEnv-->>Reconciler: POSTGRES_CONNECTION_STRING_PATH not assigned
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • liranmauda

Pre-merge checks (2 passed, 1 warning)

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The current PR description only contains Testing Instructions and omits the required template sections "Explain the changes" and "Issues: Fixed #xxx / Gap #xxx" as well as the checklist entries, so it does not follow the repository's required description template and lacks a summary of the concrete changes. Although the testing steps are useful, the description does not explain what was changed (which envs were added/removed or code changes) or reference related issues, making the description incomplete for reviewers. Therefore the check fails. Update the PR description to follow the template: add an "Explain the changes" section that summarizes the added POSTGRES_CONNECTION_STRING_PATH entries (deploy/internal/deployment-endpoint.yaml and deploy/internal/statefulset-core.yaml), the removal of the hard-coded POSTGRES_HOST value, and the conditional change in pkg/system/phase2_creating.go; add an "Issues" line with any related issue numbers or "None"; keep the provided Testing Instructions and complete the checklist (docs/tests), and mention known CI/runtime concerns (e.g., fs.readFileSync crash) and verification steps such as running make gen, make gen-api, and make lint so reviewers can validate the fixes.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title "Add missing envs for external pg db" is concise and accurately reflects the primary change in the PR—adding environment variables to support an externally managed PostgreSQL database—so it communicates the main intent to reviewers. It is short, focused, and tied to the changes described in the summary. The only minor clarity issue is the use of abbreviations ("pg" and "db") which could be expanded for readability.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request description only provides a Testing Instructions section and omits the required “Explain the changes” section, the “Issues: Fixed #xxx / Gap #xxx” section, and the checklist items for documentation and tests as specified in the repository’s description template. Please add an “Explain the changes” section summarizing the modifications made, include an “Issues: Fixed #xxx / Gap #xxx” section linking related tickets or gaps, and complete the checklist for documentation updates and added tests to align with the repository’s pull request template.
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Title Check ✅ Passed The title “Add missing envs for external pg db” accurately summarizes the primary change of the pull request, which is to introduce environment variables needed for an externally managed PostgreSQL database, and it is concise and directly related to the modifications in deployment and statefulset manifests.
✨ 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

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

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 (1)
pkg/bundle/deploy.go (1)

4115-4121: Missing runtime consumption for POSTGRES_CONNECTION_STRING_PATH

I’ve verified that the operator now injects POSTGRES_CONNECTION_STRING_PATH consistently in:

  • pkg/system/phase2_creating.go (case “POSTGRES_CONNECTION_STRING_PATH” → sets …/db_url)
  • pkg/bundle/deploy.go (both endpoint and core specs)
  • deploy/internal/statefulset-core.yaml
  • deploy/internal/deployment-endpoint.yaml

However, a repository‐wide grep for any runtime references to POSTGRES_CONNECTION_STRING_PATH (e.g. via os.Getenv, os.LookupEnv, ioutil.ReadFile, or similar) returned no hits. This means the container won’t actually read the connection-string file path you’re mounting.

Please add (or confirm existing) code in the endpoint/core service to:

  • Read os.Getenv("POSTGRES_CONNECTION_STRING_PATH") (or equivalent) at startup
  • Load the file at that path (e.g. ioutil.ReadFile)
  • Use its contents as the Postgres connection string

Without this, the new env var is declared but never consumed at runtime.

🧹 Nitpick comments (2)
deploy/internal/statefulset-core.yaml (1)

129-134: Optional: keep env ordering consistent with the embedded bundle to reduce noisy diffs

Here it’s placed after POSTGRES_PORT_PATH. AI summary indicates deploy.go may place it after POSTGRES_DBNAME_PATH. Functionally equivalent, but inconsistent ordering can cause churn in generated bundles and tests.

Use the script above to compare the relative order in pkg/bundle/deploy.go and align if they differ.

deploy/internal/deployment-endpoint.yaml (1)

120-137: Optional: add an e2e check for external PG via connection string path

Given the PR objective (“Add missing envs for external pg db”), consider adding/adjusting an e2e test that:

  • Mounts a Secret containing a connection string file,
  • Sets POSTGRES_CONNECTION_STRING_PATH to that file path,
  • Verifies successful startup and DB connectivity.

I can sketch the test plan or a small harness to validate this path-based configuration in CI.

📜 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 2f4a6b4 and 393aed7.

📒 Files selected for processing (3)
  • deploy/internal/deployment-endpoint.yaml (1 hunks)
  • deploy/internal/statefulset-core.yaml (1 hunks)
  • pkg/bundle/deploy.go (2 hunks)
🔇 Additional comments (2)
deploy/internal/deployment-endpoint.yaml (1)

129-129: Confirmed: POSTGRES_CONNECTION_STRING_PATH is in sync
The POSTGRES_CONNECTION_STRING_PATH entry appears at line 129 in deploy/internal/deployment-endpoint.yaml and is also present at line 4119 in the embedded bundle within pkg/bundle/deploy.go. No further updates are needed here—bundle and manifest are aligned.

pkg/bundle/deploy.go (1)

5229-5234: Verification of POSTGRES_CONNECTION_STRING_PATH usage in manifests

The rg output confirms that both statefulset-core.yaml and deployment-endpoint.yaml include the new POSTGRES_CONNECTION_STRING_PATH entry alongside the other POSTGRES_*_PATH variables. No other manifests under deploy/ contain this pattern, so parity is maintained across embedded manifests.

Next steps:

  • Confirm that the application code (or operator) actually reads POSTGRES_CONNECTION_STRING_PATH, loads the file it points to, and falls back appropriately to POSTGRES_CONNECTION_STRING if the path variant is unset.
  • If the code does not support this fallback, update it or ensure the operator always sets exactly one of the two variables.

Please verify the wiring in the core service’s configuration loader to ensure end-to-end support of the path-based override.

@nimrod-becker
Copy link
Contributor

@alphaprinz @jackyalbo Please review

Copy link
Contributor

@jackyalbo jackyalbo left a comment

Choose a reason for hiding this comment

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

LGTM, @dannyzaken was this just something we missed?

Copy link
Contributor

@jackyalbo jackyalbo left a comment

Choose a reason for hiding this comment

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

@anisurrahman75 Can you run make gen and make gen-api and attach the changes to this PR as it doesn't pass the testes currently

@liranmauda
Copy link
Contributor

liranmauda commented Aug 28, 2025

@anisurrahman75 Can you run make gen and make gen-api and attach the changes to this PR as it doesn't pass the testes currently

Also, make lint and rebase

@liranmauda
Copy link
Contributor

@anisurrahman75 could you squash the commits?

@anisurrahman75
Copy link
Author

@liranmauda brother, I've rebased with the latest changes. Can you merge this PR?

@liranmauda
Copy link
Contributor

The tests are failing. Need to figure out why
@achouhan09 could you take a look?

@aayushchouhan09
Copy link
Member

Hi
The issue is with the Noobaa core code handling of the POSTGRES_CONNECTION_STRING_PATH parameter. Currently, we are reading it directly using the fs.readFileSync() function, which throws an exception if the parameter is undefined. As a result, the NooBaa core pod keeps crashing which is failing the CI jobs.
We need to handle it the same way we do for other parameters, by reading it with the fs_utils.try_read_file_sync() function, which provides better exception handling.
cc @liranmauda

Copy link
Member

@dannyzaken dannyzaken left a comment

Choose a reason for hiding this comment

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

@anisurrahman75, I mistakenly approved before.
It is correct to add POSTGRES_CONNECTION_STRING_PATH into the core and endpoint yamls.
In addition, here, we are also missing checking if we are using an external PG before setting a value for that env.

		if r.NooBaa.Spec.ExternalPgSecret != nil {
			c.Env[j].Value = postgresSecretMountPath + "/db_url"
		}

@aayushchouhan09
Copy link
Member

Hi The issue is with the Noobaa core code handling of the POSTGRES_CONNECTION_STRING_PATH parameter. Currently, we are reading it directly using the fs.readFileSync() function, which throws an exception if the parameter is undefined. As a result, the NooBaa core pod keeps crashing which is failing the CI jobs. We need to handle it the same way we do for other parameters, by reading it with the fs_utils.try_read_file_sync() function, which provides better exception handling. cc @liranmauda

Please ignore this comment. Thanks!

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 (3)
pkg/system/phase2_creating.go (1)

557-563: Remove POSTGRES_CONNECTION_STRING_PATH from the endpoint manifest
Drop the POSTGRES_CONNECTION_STRING_PATH env var entry from deploy/internal/deployment-endpoint.yaml (around line 130); the endpoint doesn’t need DB connectivity by default. Only inject this variable when ExternalPgSecret is set—mirroring the handling in statefulset-core.yaml.

pkg/bundle/deploy.go (2)

4099-4115: Add missing POSTGRES_CONNECTION_STRING_PATH to endpoint env.

The PR goal mentions adding POSTGRES_CONNECTION_STRING_PATH, but the noobaa-endpoint Deployment still lacks this placeholder. Without it, downstream logic that expects this key (or tooling that checks for parity across POSTGRES_*_PATH vars) will miss it.

Apply this diff right after POSTGRES_PORT_PATH:

             - name: POSTGRES_HOST_PATH
             - name: POSTGRES_USER_PATH
             - name: POSTGRES_PASSWORD_PATH
             - name: POSTGRES_DBNAME_PATH
             - name: POSTGRES_PORT_PATH
+            - name: POSTGRES_CONNECTION_STRING_PATH

5217-5225: Add missing POSTGRES_CONNECTION_STRING_PATH to core env.

Same gap exists in the noobaa-core StatefulSet. Add the placeholder so the operator can populate it when ExternalPgSecret is present.

             - name: POSTGRES_HOST_PATH
             - name: POSTGRES_USER_PATH
             - name: POSTGRES_PASSWORD_PATH
             - name: POSTGRES_DBNAME_PATH
             - name: POSTGRES_PORT_PATH
+            - name: POSTGRES_CONNECTION_STRING_PATH
📜 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 6a76bb7 and 550e6ad.

📒 Files selected for processing (5)
  • .gitignore (1 hunks)
  • deploy/internal/deployment-endpoint.yaml (1 hunks)
  • deploy/internal/statefulset-core.yaml (1 hunks)
  • pkg/bundle/deploy.go (4 hunks)
  • pkg/system/phase2_creating.go (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .gitignore
🚧 Files skipped from review as they are similar to previous changes (2)
  • deploy/internal/deployment-endpoint.yaml
  • deploy/internal/statefulset-core.yaml
🔇 Additional comments (3)
pkg/bundle/deploy.go (3)

3984-4165: Confirm endpoint actually needs the connection string path.

If only core consumes POSTGRES_CONNECTION_STRING_PATH, keep the endpoint manifest lean and drop it there; otherwise, ensure the operator also populates it for endpoints.


3982-3984: Regenerate bundle SHAs after YAML edits
Makefile targets weren’t found in this environment; manually run make gen && make gen-api locally and commit the updated Sha256_* constants so CI integrity checks pass.


5091-5296: Operator correctly guards POSTGRES_CONNECTION_STRING_PATH assignment

setDesiredCoreEnv only injects POSTGRES_CONNECTION_STRING_PATH when ExternalPgSecret is non-nil; please verify the core code path uses a safe file-read (e.g. fs_utils.try_read_file_sync) so an empty or missing path won’t crash the pod.

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)
pkg/system/phase2_creating.go (2)

516-525: Also remove the variable entirely after the loop

Filter c.Env to eliminate POSTGRES_CONNECTION_STRING_PATH unless ExternalPgSecret is in use. This guarantees the var is not visible to core when using the internal DB or CNPG.

   }
 
+  // Drop POSTGRES_CONNECTION_STRING_PATH entirely unless an external PG secret is in use.
+  if r.NooBaa.Spec.ExternalPgSecret == nil {
+    filtered := make([]corev1.EnvVar, 0, len(c.Env))
+    for _, e := range c.Env {
+      if e.Name != "POSTGRES_CONNECTION_STRING_PATH" {
+        filtered = append(filtered, e)
+      }
+    }
+    c.Env = filtered
+  }
+
   if r.NooBaa.Spec.BucketNotifications.Enabled {

Run to verify no empty POSTGRES_CONNECTION_STRING_PATH remains in rendered specs:

#!/bin/bash
# Check operator code and embedded manifests for unconditional uses
rg -nP "POSTGRES_CONNECTION_STRING_PATH|POSTGRES_PORT_PATH|POSTGRES_\\w+_PATH" -C2 deploy pkg | sed -n '1,200p'

490-492: Prevent core crash: drop POSTGRES_CONNECTION_STRING_PATH when ExternalPgSecret is not set

Leaving this env var present (empty or pointing to a non-mounted path) makes core read it and crash (fs.readFileSync on empty/missing path). Set it only when ExternalPgSecret is provided; otherwise clear it here and remove it after the loop (next comment).

Apply this diff:

 case "POSTGRES_CONNECTION_STRING_PATH":
-            if r.NooBaa.Spec.ExternalPgSecret != nil {
-                c.Env[j].Value = postgresSecretMountPath + "/db_url"
-            }
+            if r.NooBaa.Spec.ExternalPgSecret != nil {
+                c.Env[j].Value = postgresSecretMountPath + "/db_url"
+            } else {
+                // ensure no accidental reads by core
+                c.Env[j].Value = ""
+                c.Env[j].ValueFrom = nil
+            }
🧹 Nitpick comments (1)
pkg/system/phase2_creating.go (1)

479-489: Gate the other POSTGRES_*_PATH envs to secret-mounted cases (defensive)

Optional hardening: only set file-path envs when CNPG or ExternalPgSecret is used; otherwise clear them to avoid accidental file reads from non-existent mounts.

-    case "POSTGRES_DBNAME_PATH":
-      c.Env[j].Value = postgresSecretMountPath + "/dbname"
+    case "POSTGRES_DBNAME_PATH":
+      if r.shouldReconcileCNPGCluster() || r.NooBaa.Spec.ExternalPgSecret != nil {
+        c.Env[j].Value = postgresSecretMountPath + "/dbname"
+      } else {
+        c.Env[j].Value = ""
+        c.Env[j].ValueFrom = nil
+      }
-    case "POSTGRES_PASSWORD_PATH":
-      c.Env[j].Value = postgresSecretMountPath + "/password"
+    case "POSTGRES_PASSWORD_PATH":
+      if r.shouldReconcileCNPGCluster() || r.NooBaa.Spec.ExternalPgSecret != nil {
+        c.Env[j].Value = postgresSecretMountPath + "/password"
+      } else {
+        c.Env[j].Value = ""
+        c.Env[j].ValueFrom = nil
+      }
-    case "POSTGRES_PORT_PATH":
-      c.Env[j].Value = postgresSecretMountPath + "/port"
+    case "POSTGRES_PORT_PATH":
+      if r.shouldReconcileCNPGCluster() || r.NooBaa.Spec.ExternalPgSecret != nil {
+        c.Env[j].Value = postgresSecretMountPath + "/port"
+      } else {
+        c.Env[j].Value = ""
+        c.Env[j].ValueFrom = nil
+      }
-    case "POSTGRES_USER_PATH":
-      c.Env[j].Value = postgresSecretMountPath + "/username"
+    case "POSTGRES_USER_PATH":
+      if r.shouldReconcileCNPGCluster() || r.NooBaa.Spec.ExternalPgSecret != nil {
+        c.Env[j].Value = postgresSecretMountPath + "/username"
+      } else {
+        c.Env[j].Value = ""
+        c.Env[j].ValueFrom = nil
+      }
-    case "POSTGRES_HOST_PATH":
-      c.Env[j].Value = postgresSecretMountPath + "/host"
+    case "POSTGRES_HOST_PATH":
+      if r.shouldReconcileCNPGCluster() || r.NooBaa.Spec.ExternalPgSecret != nil {
+        c.Env[j].Value = postgresSecretMountPath + "/host"
+      } else {
+        c.Env[j].Value = ""
+        c.Env[j].ValueFrom = nil
+      }

Also applies to: 481-486

📜 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 550e6ad and 3e15da0.

📒 Files selected for processing (5)
  • .gitignore (1 hunks)
  • deploy/internal/deployment-endpoint.yaml (1 hunks)
  • deploy/internal/statefulset-core.yaml (1 hunks)
  • pkg/bundle/deploy.go (4 hunks)
  • pkg/system/phase2_creating.go (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • .gitignore
  • deploy/internal/statefulset-core.yaml
  • deploy/internal/deployment-endpoint.yaml
  • pkg/bundle/deploy.go
🧰 Additional context used
🧬 Code graph analysis (1)
pkg/system/phase2_creating.go (1)
pkg/apis/noobaa/v1alpha1/noobaa_types.go (1)
  • NooBaa (40-55)
🔇 Additional comments (1)
pkg/system/phase2_creating.go (1)

557-562: Add conditional removal of POSTGRES_CONNECTION_STRING_PATH for endpoint container

POSTGRES_CONNECTION_STRING_PATH is embedded unconditionally in both statefulset-core.yaml and deployment-endpoint.yaml. Confirm that r.setDesiredCoreEnv(c) strips this var when ExternalPgSecret is disabled—and implement equivalent stripping in the endpoint creation path (e.g. via a setDesiredEndpointEnv call).

@anisurrahman75
Copy link
Author

https://github.com/noobaa/noobaa-operator/blob/master/pkg/bundle/deploy.go#L5213

- name: POSTGRES_HOST
  value: "noobaa-db-pg-0.noobaa-db-pg"

@dannyzaken, I guess, we've to keep this field empty.

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

🧹 Nitpick comments (2)
pkg/bundle/deploy.go (2)

3982-4166: Add POSTGRES_CONNECTION_STRING_PATH to endpoint envs looks correct; verify population logic.

The new POSTGRES_CONNECTION_STRING_PATH entry aligns with supporting an external PG connection string. Please verify:

  • The operator populates this env var for the endpoint pod whenever ExternalPgSecret is present (same as for core), and leaves it unset otherwise.
  • E2E: with an external PG Secret, endpoint pod spec contains POSTGRES_CONNECTION_STRING_PATH with the expected value.

If both connection string and discrete POSTGRES_* vars can be set, prefer one source of truth and log a warning when both are present.


5092-5300: Core StatefulSet: connection-string path added; ensure safe read and internal-DB defaults remain intact.

Good addition of POSTGRES_CONNECTION_STRING_PATH. Two verifications to avoid regressions:

  • Core read path: NooBaa core previously used fs.readFileSync() on POSTGRES_CONNECTION_STRING_PATH and could throw when undefined. Confirm the core now guards this (e.g., try_read_file_sync) or only reads it when the env var is set; otherwise, pods without ExternalPgSecret may still crash.
  • Internal DB flow: POSTGRES_HOST hard-coded value was removed. Ensure the operator still sets POSTGRES_HOST (and other POSTGRES_* envs) for the managed/internal DB case so core continues to boot without an external secret.

Optionally, add a sanity check: when POSTGRES_CONNECTION_STRING_PATH is set, ignore discrete POSTGRES_* envs and emit a clear log to avoid ambiguity.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 706506e and b4851d8.

📒 Files selected for processing (5)
  • .gitignore (1 hunks)
  • deploy/internal/deployment-endpoint.yaml (1 hunks)
  • deploy/internal/statefulset-core.yaml (1 hunks)
  • pkg/bundle/deploy.go (4 hunks)
  • pkg/system/phase2_creating.go (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • .gitignore
  • pkg/system/phase2_creating.go
  • deploy/internal/deployment-endpoint.yaml
  • deploy/internal/statefulset-core.yaml

@dannyzaken
Copy link
Member

https://github.com/noobaa/noobaa-operator/blob/master/pkg/bundle/deploy.go#L5213

- name: POSTGRES_HOST
  value: "noobaa-db-pg-0.noobaa-db-pg"

@dannyzaken, I guess, we've to keep this field empty.

yes. for external DB we only use the connection string

@Skiepp
Copy link

Skiepp commented Oct 4, 2025

I can confirm the related issue is a blocker for a clean installation with an external database

Thanks for your work, hopefully will be merged soon 👍

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.

7 participants