Provide warning for ImageStreams#31
Conversation
When plugin process ImageStream resource, it should provide a warning since images are not subject of migration by the plugin. Fixes: migtools/crane#452 Signed-off-by: Marek Aufart <maufart@redhat.com>
📝 WalkthroughWalkthroughThe PR adds an ChangesImageStream Whiteout and Documentation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@openshift/plugin.go`:
- Around line 92-99: The case statement checking for "ImageStream" at line 92
only validates the kind without checking the API group, which allows
non-OpenShift resources with the same kind to be incorrectly whiteout'd. Add an
additional check to verify that the unstructured object u belongs to the
image.openshift.io API group before executing the whiteout logic and logging the
warning message. Extract the API group from the object (via GetAPIVersion or
similar method on the unstructured object) and confirm it matches the OpenShift
image API group namespace before proceeding with the namespace, name extraction,
and whiteOut assignment.
In `@README.md`:
- Around line 26-29: The fenced code block containing the warning and info
messages about ImageStream and registry migration is missing a language
identifier, which violates the markdown linting rule MD040. Add the language
identifier `text` to the opening triple backticks of this code block to specify
that the content is plain text, changing the opening from triple backticks to
triple backticks followed by `text`.
🪄 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
Run ID: a9a3be57-5949-43d6-ad3a-58df0e8590eb
📒 Files selected for processing (3)
README.mdopenshift/plugin.goopenshift/plugin_test.go
Signed-off-by: Marek Aufart <maufart@redhat.com>
Signed-off-by: Marek Aufart <maufart@redhat.com>
Signed-off-by: Marek Aufart <maufart@redhat.com>
There was a problem hiding this comment.
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 @.github/workflows/pr-checks.yml:
- Around line 12-18: The workflow uses floating action version tags
(actions/setup-go@v5 and actions/checkout@v4) which weakens supply-chain
security by allowing action updates without explicit control. Replace the
floating tags with pinned commit SHAs for both the setup-go and checkout
actions. Additionally, add persist-credentials: false to the checkout action to
prevent unnecessary credential exposure in PR-triggered runs.
🪄 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
Run ID: d511044a-4dd3-4f2b-8d3a-67ee9665f4d4
📒 Files selected for processing (3)
.github/workflows/pr-checks.ymlREADME.mdopenshift/plugin_test.go
✅ Files skipped from review due to trivial changes (1)
- README.md
🚧 Files skipped from review as they are similar to previous changes (1)
- openshift/plugin_test.go
When plugin process ImageStream resource, it should provide a warning since images are not subject of migration by the plugin (should be solved outside of crane with e.g. skopeo).
Also populating README file and adding basic PR golang check (unit test and build to spot a failure soon enough).
Fixes: migtools/crane#452
Summary by CodeRabbit
Summary by CodeRabbit
Documentation
New Features
Tests
Chores