Skip to content

[BUILD-1756] feat: support pushing output images to OpenShift imagestreams - #144

Merged
psrvere merged 3 commits into
migtools:mainfrom
psrvere:BUILD-1756-imagestream-push
Jul 21, 2026
Merged

[BUILD-1756] feat: support pushing output images to OpenShift imagestreams#144
psrvere merged 3 commits into
migtools:mainfrom
psrvere:BUILD-1756-imagestream-push

Conversation

@psrvere

@psrvere psrvere commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Convert ImageStreamTag output to internal registry URL (image-registry.openshift-image-registry.svc:5000/<namespace>/<name>:<tag>) instead of warning "not supported"
  • Emit info log with the converted URL for visibility
  • Warn when no explicit pushSecret is set (user needs a ServiceAccount with registry push access)
  • Default to :latest tag when ImageStreamTag name has no colon (matches OpenShift behavior)
  • Remove the ImageStreamsPushRFE constant from rfe.go (feature now implemented)

Test plan

  • Unit tests: 76/76 PASS (includes new test cases for cross-namespace, tagless, with/without pushSecret)
  • Cluster test: BuildConfig (IST output) → crane convert → Shipwright Build → BuildRun push → PASS
  • Image pull verification: Pod pulled image from internal registry, content matched expected output
  • Cluster: OpenShift 4.20.0-0.nightly-2026-07-15-212908

Related

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • ImageStreamTag outputs now default to the latest tag when no tag is provided.
    • ImageStreamTag references support custom and cross-namespace targets.
    • Informational messages clarify image conversion behavior.
  • Bug Fixes

    • Added a warning when no push secret is configured for ImageStreamTag outputs.

psrvere and others added 3 commits July 16, 2026 16:26
The warning claimed ImageStream push was unsupported in Shipwright,
but it works when the BuildRun uses a ServiceAccount with internal
registry push access (e.g., the 'pipeline' SA managed by OpenShift
Pipelines). Replace the warning with info logs that explain the
converted URL and the SA requirement when no explicit pushSecret
is configured.

Resolves: BUILD-1756

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…essage

- Add tests for ImageStreamTag output URL construction (with/without pushSecret)
- Change guidance log from Infof to Warnf (advises user action needed)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Prateek Singh Rathore <prateek.singh.rathore@gmail.com>
- Rename duplicate test "ImageStreamTag output without pushSecret" to avoid confusion
- Default to :latest when ImageStreamTag name has no colon (matches OpenShift behavior)
- Add test for cross-namespace ImageStreamTag reference
- Add test for ImageStreamTag name without tag

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

ImageStreamTag output conversion now defaults missing tags to latest, builds URLs from normalized references, and conditionally warns about missing push secrets. Tests cover namespace and secret combinations, while an obsolete RFE constant is removed.

Changes

ImageStreamTag output conversion

Layer / File(s) Summary
Normalize ImageStreamTag outputs
convert/buildconfigs.go, convert/rfe.go
ImageStreamTag names without tags receive :latest; normalized names are used for internal registry URLs, push-secret warnings are conditional, and ImageStreamsPushRFE is removed.
Cover ImageStreamTag cases
convert/buildconfigs_test.go
Tests cover custom namespaces, push secrets, cross-namespace references, and default latest tags.

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

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding support for pushing output images to OpenShift imagestreams.
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.
✨ 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
convert/buildconfigs_test.go (1)

390-391: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Rename test case to avoid a duplicate name.

There is already an existing test case at line 307 named "ImageStreamTag output with pushSecret". To distinguish this test and more accurately reflect its specific scenario, consider appending - custom namespace to the name, similar to the preceding test case.

♻️ Proposed refactor
 		{
-			name: "ImageStreamTag output with pushSecret",
+			name: "ImageStreamTag output with pushSecret - custom namespace",
🤖 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 `@convert/buildconfigs_test.go` around lines 390 - 391, Rename the duplicate
test case in the test table to distinguish its custom-namespace scenario,
appending “- custom namespace” to the existing “ImageStreamTag output with
pushSecret” name while leaving the test logic unchanged.
🤖 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.

Nitpick comments:
In `@convert/buildconfigs_test.go`:
- Around line 390-391: Rename the duplicate test case in the test table to
distinguish its custom-namespace scenario, appending “- custom namespace” to the
existing “ImageStreamTag output with pushSecret” name while leaving the test
logic unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c2e128de-5945-45d7-b16b-1f079fd3cfa3

📥 Commits

Reviewing files that changed from the base of the PR and between 99125df and d7e81f9.

📒 Files selected for processing (3)
  • convert/buildconfigs.go
  • convert/buildconfigs_test.go
  • convert/rfe.go
💤 Files with no reviewable changes (1)
  • convert/rfe.go

@psrvere
psrvere merged commit 0bd6b2a into migtools:main Jul 21, 2026
2 checks passed
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