Skip to content

OKD-380: Add missing namespace to image trigger annotations#660

Merged
phracek merged 1 commit into
sclorg:masterfrom
pskrbasu:fix/image-trigger-namespace
Jun 23, 2026
Merged

OKD-380: Add missing namespace to image trigger annotations#660
phracek merged 1 commit into
sclorg:masterfrom
pskrbasu:fix/image-trigger-namespace

Conversation

@pskrbasu

@pskrbasu pskrbasu commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Problem

Deploying PostgreSQL from the OKD 4.22 Software Catalog fails with:

spec.containers[0].image: Invalid value: " ": must not have leading or trailing whitespace

Reported in okd-project/okd#2337

Root Cause

When templates were migrated from DeploymentConfig to Deployment, the image.openshift.io/triggers annotation dropped the namespace field from the ImageStreamTag reference. Without it, the image trigger controller defaults to the Deployment's own namespace instead of openshift, so it can't find the ImageStream and the container image is never resolved.

Fix

Add "namespace":"${NAMESPACE}" to the trigger annotation's from object in both postgresql-persistent and postgresql-ephemeral templates. The NAMESPACE parameter already exists in both templates with a default value of "openshift".

Impact

These template files are the upstream source for openshift/library (via make import) and ultimately openshift/cluster-samples-operator. An immediate fix was applied directly to the operator in openshift/cluster-samples-operator#701. This upstream fix ensures the bug doesn't recur on the next sync.

Summary by CodeRabbit

  • Chores
    • Updated PostgreSQL template configurations to include explicit namespace specifications for container image resolution in OpenShift environments, improving deployment reliability.

The image.openshift.io/triggers annotation on database Deployments is
missing the namespace field in the ImageStreamTag reference. Without it,
the image trigger controller looks for ImageStreams in the user's namespace
instead of 'openshift', causing image resolution to fail.

Add "namespace":"${NAMESPACE}" to the trigger from object in both
postgresql-persistent and postgresql-ephemeral templates.

Related: okd-project/okd#2337

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Both OpenShift PostgreSQL template files (postgresql-ephemeral-template.json and postgresql-persistent-template.json) are updated to add a "namespace":"${NAMESPACE}" field to the ImageStreamTag reference inside the Deployment's image.openshift.io/triggers annotation.

Changes

ImageStreamTag Namespace in Deployment Triggers

Layer / File(s) Summary
Add namespace to ImageStreamTag trigger annotations
examples/postgresql-ephemeral-template.json, examples/postgresql-persistent-template.json
The image.openshift.io/triggers annotation on the Deployment object in both templates is updated so the referenced ImageStreamTag now includes "namespace": "${NAMESPACE}", where previously no namespace was specified.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A rabbit hops through template land,
Where namespaces were left unplanned.
🐇 Now ${NAMESPACE} joins the tag,
No more lost streams left to drag.
Each trigger knows just where to look! 🎯

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main change: adding missing namespace fields to image trigger annotations in the two PostgreSQL template files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown

Pull Request validation

Failed

🔴 Review - Missing review from a member (1 required)

Success

🟢 CI - All checks have passed


Triggered by Workflow Run

@phracek

phracek commented Jun 23, 2026

Copy link
Copy Markdown
Member

[test-openshift-pytest]

@phracek phracek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Thanks.

@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown

Testing Farm results

namecomposearchstatusstarted (UTC)timelogs
RHEL10 - PyTest - OpenShift 4 - 18RHEL-10.2-Nightlyx86_64✅ passed23.06.2026 08:53:1517min 18stest pipeline
RHEL8 - PyTest - OpenShift 4 - 15RHEL-8.10.0-Nightlyx86_64✅ passed23.06.2026 10:32:1228min 53stest pipeline
RHEL8 - PyTest - OpenShift 4 - 13RHEL-8.10.0-Nightlyx86_64✅ passed23.06.2026 10:32:1221min 28stest pipeline
RHEL9 - PyTest - OpenShift 4 - 18RHEL-9.8.0-Nightlyx86_64✅ passed23.06.2026 09:13:1128min 26stest pipeline
RHEL9 - PyTest - OpenShift 4 - 16RHEL-9.8.0-Nightlyx86_64✅ passed23.06.2026 10:32:1134min 57stest pipeline
RHEL9 - PyTest - OpenShift 4 - 15RHEL-9.8.0-Nightlyx86_64✅ passed23.06.2026 10:32:1432min 44stest pipeline
RHEL8 - PyTest - OpenShift 4 - 12RHEL-8.10.0-Nightlyx86_64✅ passed23.06.2026 10:32:1323min 3stest pipeline
RHEL8 - PyTest - OpenShift 4 - 16RHEL-8.10.0-Nightlyx86_64✅ passed23.06.2026 10:32:1323min 27stest pipeline
RHEL9 - PyTest - OpenShift 4 - 13RHEL-9.8.0-Nightlyx86_64✅ passed23.06.2026 10:32:1130min 42stest pipeline
RHEL10 - PyTest - OpenShift 4 - 16RHEL-10.2-Nightlyx86_64✅ passed23.06.2026 10:32:1331min 36stest pipeline

@phracek phracek merged commit f1c89bc into sclorg:master Jun 23, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants