Skip to content

OCPBUGS-90096: Make dry-run also generate cluster-resources#1394

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
javipolo:dry-run-cluster-resources
Jun 29, 2026
Merged

OCPBUGS-90096: Make dry-run also generate cluster-resources#1394
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
javipolo:dry-run-cluster-resources

Conversation

@javipolo

@javipolo javipolo commented Apr 24, 2026

Copy link
Copy Markdown
Member

Description

Create cluster-resource manifests while running with --dry-run flag

Github / Jira issue:

https://redhat.atlassian.net/browse/RFE-4107

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Run oc-mirror with --dry-run and manifests should apear in working-dir/cluster-resources
It was tested manually

Expected Outcome

Manifests should be present in cluster-resources directory

Summary by CodeRabbit

  • New Features

    • Dry-run now writes image mapping output immediately, always logs its path, and creates a missing-image report only when missing images are detected. Cluster resource generation is skipped when mirroring to disk; otherwise IDMS/ITMS, catalog manifests and signature ConfigMap are produced. UpdateService is generated when graph/release images are resolvable.
  • Tests

    • Refactored/expanded dry-run tests into table-driven cases validating mapping output, missing-image handling, conditional cluster-resources, catalog manifests, and UpdateService content.

@coderabbitai

coderabbitai Bot commented Apr 24, 2026

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

DryRun now writes mapping output immediately, exposes missing-image counts via a helper that creates missing.txt, and conditionally performs best-effort cluster resource generation (IDMS/ITMS, CatalogSource, ClusterCatalog, signature ConfigMap, and UpdateService when graph is enabled). Tests are refactored to shared setup and table-driven scenarios covering missing-image and cluster-resources cases.

Changes

Cluster Resource Generation & DryRun flow

Layer / File(s) Summary
DryRun entry and mapping write
internal/pkg/cli/dryrun.go
Processes images up front, writes mapping.txt with %w-wrapped errors, delegates missing-image output to writeMissingImagesFile, and conditionally triggers cluster resource generation when not mirroring to disk.
Cluster resource helpers
internal/pkg/cli/dryrun.go
Adds generateClusterResources to best-effort generate IDMS/ITMS, CatalogSource, ClusterCatalog, and signature ConfigMap; logs generator failures as warnings and continues.
UpdateService generation
internal/pkg/cli/dryrun.go
Adds generateUpdateService to resolve graph and release images and call ClusterResources.UpdateServiceGenerator; resolution/generation errors are logged as warnings.
Missing images / processImages
internal/pkg/cli/dryrun.go
Adds writeMissingImagesFile to emit missing.txt when images are missing and logs counts; processImages now returns nbMissingImgs.
Tests: shared helpers & scenarios
internal/pkg/cli/dryrun_test.go
Introduces shared setup helpers (setupTestEnvironment, createTestExecutor, getTestImages), refactors TestDryRun to table-driven scenarios, and adds assertions for mapping.txt, missing.txt, cluster-resources manifests, and UpdateService contents.
sequenceDiagram
  participant User
  participant DryRun
  participant ProcessImages
  participant ClusterResources
  participant Generators
  participant FileSystem

  User->>DryRun: invoke DryRun()
  DryRun->>ProcessImages: process images
  ProcessImages-->>DryRun: images list, nbMissingImgs
  DryRun->>FileSystem: write mapping.txt
  DryRun->>DryRun: writeMissingImagesFile(nbMissingImgs)
  DryRun->>ClusterResources: generateClusterResources(allImages) (if not to-disk)
  ClusterResources->>Generators: run IDMS/ITMS, Catalog, SigConfigMap generators
  Generators->>FileSystem: write manifests/catalogs
  alt OCP release present
    ClusterResources->>Generators: resolve graph/release, generate UpdateService
    Generators->>FileSystem: write UpdateService manifest
  end
  DryRun-->>User: dry-run complete
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 13 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Test Structure And Quality ❓ Inconclusive Custom check requires reviewing "Ginkgo test code," but the modified test file uses standard Go testing with t.Run, not Ginkgo. The codebase does not use Ginkgo. Clarify if check applies to standard Go tests or only Ginkgo. PR modifies only standard Go test code.
✅ Passed checks (13 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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.
Stable And Deterministic Test Names ✅ Passed The custom check applies to Ginkgo test names. The PR modifies internal/pkg/cli/dryrun_test.go which uses standard Go testing.T with table-driven tests, not Ginkgo. Check is not applicable.
Microshift Test Compatibility ✅ Passed The PR modifies unit tests (dryrun_test.go) using standard Go testing, not Ginkgo e2e tests. The MicroShift compatibility check applies only to Ginkgo e2e tests and is not applicable here.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR modifies only standard Go unit tests (using testing.T and t.Run), not Ginkgo e2e tests (It, Describe, Context, When). Custom check applies only to new Ginkgo e2e tests.
Topology-Aware Scheduling Compatibility ✅ Passed PR generates OpenShift configuration resources (IDMS, CatalogSource, UpdateService CRD), not workload deployments. No topology-incompatible scheduling constraints found.
Ote Binary Stdout Contract ✅ Passed No stdout violations. Both dryrun.go and dryrun_test.go have no fmt.Print, direct stdout writes, or klog at process level. All logging uses clog which defaults to stderr.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No Ginkgo e2e tests are added in this PR. The changes are in standard Go unit tests (using testing.T, not Ginkgo patterns). Not applicable to the custom check.
No-Weak-Crypto ✅ Passed No weak crypto patterns found. Files use only standard library imports and no MD5, SHA1, DES, RC4, 3DES, Blowfish, ECB, or unsafe secret comparisons.
Container-Privileges ✅ Passed PR modifies only Go source code files (dryrun.go, dryrun_test.go); no Kubernetes manifests, container specs, or Dockerfile changes. No privileged container settings found.
No-Sensitive-Data-In-Logs ✅ Passed DEBUG log at line 143 logs img.Destination (image reference), but DEBUG logs only appear with explicit verbose logging enabled, presenting minimal security risk.
Title check ✅ Passed The title directly and clearly describes the main change: adding cluster-resources generation to the dry-run functionality, which is the primary feature of this PR.

✏️ 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.

@openshift-ci openshift-ci Bot requested review from adolfo-ab and aguidirh April 24, 2026 09:35

@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.

Actionable comments posted: 3

🧹 Nitpick comments (2)
internal/pkg/cli/dryrun.go (1)

77-91: Consider downgrading cluster-resource failures to warnings, and drop the ClusterResources == nil guard in favor of test mocks.

Two small points:

  • DryRun previously always succeeded when the mapping and (optionally) missing files were produced. Now any failure from IDMS_ITMSGenerator, CatalogSourceGenerator, ClusterCatalogGenerator, or UpdateServiceGenerator fails the whole dry-run. GenerateSignatureConfigMap is already correctly downgraded to a warning — consider the same treatment for the others so cluster-resource generation issues don't mask the main dry-run output.
  • The if o.ClusterResources == nil check (with the comment "e.g., in tests") is production code working around test setup. The existing executor_test.go has a MockClusterResources no-op implementation — updating the older TestDryRun sub-tests to inject that mock (like the new sub-test does with clusterresources.New) removes the need for the nil guard.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@internal/pkg/cli/dryrun.go` around lines 77 - 91, Adjust
generateClusterResourcesForDryRun so cluster-resource generator failures are
logged as warnings instead of returning errors: for IDMS_ITMSGenerator,
CatalogSourceGenerator, ClusterCatalogGenerator, and UpdateServiceGenerator
catch errors from their calls, call o.Log.Warnf with a descriptive message and
continue (mirroring the existing treatment of GenerateSignatureConfigMap), and
return nil at the end unless a non-cluster-resource fatal condition occurs; also
remove the if o.ClusterResources == nil guard and update tests to inject
MockClusterResources (e.g., in TestDryRun) so production code no longer
compensates for test setup.
internal/pkg/cli/dryrun_test.go (1)

199-203: Shared global is mutated across sub-tests.

global is declared once at the top of TestDryRun and each sub-test does global.WorkingDir = testFolder. That's fine while t.Run sub-tests execute serially, but it's a foot-gun if anyone later adds t.Parallel(). Consider constructing a fresh *mirror.GlobalOptions per sub-test.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@internal/pkg/cli/dryrun_test.go` around lines 199 - 203, The test mutates the
package-level variable global across sub-tests (global.WorkingDir = testFolder),
which is unsafe for parallel runs; instead, create a fresh *mirror.GlobalOptions
per sub-test (e.g., local := &mirror.GlobalOptions{WorkingDir: testFolder, ...})
inside the t.Run closure and use that local instance in calls that currently
rely on the package-global, or assign the package-global once from that local
before invoking the code under test. Update uses of global in TestDryRun
sub-tests to reference the new local variable (or set global = local at the
start of the subtest) so each sub-test has its own independent GlobalOptions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@internal/pkg/cli/dryrun_test.go`:
- Around line 282-289: The test's assertions are too weak — they only check that
cluster-resources/ exists but not that the new manifests are created or correct;
update the test in dryrun_test.go to assert specific files exist under
clusterResourcesDir (e.g., idms-oc-mirror.yaml, itms-oc-mirror.yaml, the catalog
source and cluster catalog manifests, the signature ConfigMap, and the
UpdateService manifest for the OCPRelease image) and then read the UpdateService
manifest file to assert its graph image reference matches the value produced by
constructGraphImageRef (or at least contains the expected repository/name like
"graph-data" and not the hardcoded "localhost:5000"), so the test fails if the
OCP-release path or graph image generation regresses.

In `@internal/pkg/cli/dryrun.go`:
- Around line 142-169: Replace the custom, hardcoded logic in
constructGraphImageRef with a call to the real implementation: invoke
o.Release.GraphImage() and return its result (propagate any error), removing the
unused releaseImageParts split and the bogus localhost:5000 fallback and the
incorrect "openshift/graph-data:latest" name; this ensures the dry-run uses the
same registry and image name (openshift/graph-image) as the real flow and stops
relying on ImageSetConfigurationSpec.Mirror.AdditionalImages parsing.
- Around line 116-137: The test data includes release image Origins with the
"docker://" transport prefix which must be stripped before calling
UpdateServiceGenerator; in the loop that finds v2alpha1.TypeOCPRelease (using
allImages and releaseImage), call strings.TrimPrefix(img.Origin,
consts.DockerProtocol) (or trim releaseImage right after assignment) and pass
that trimmed value to o.ClusterResources.UpdateServiceGenerator(graphImageRef,
releaseImage) (ensure constructGraphImageRef still receives the correct input),
so UpdateServiceGenerator gets the unprefixed release image string matching
production ReleaseImage() behavior.

---

Nitpick comments:
In `@internal/pkg/cli/dryrun_test.go`:
- Around line 199-203: The test mutates the package-level variable global across
sub-tests (global.WorkingDir = testFolder), which is unsafe for parallel runs;
instead, create a fresh *mirror.GlobalOptions per sub-test (e.g., local :=
&mirror.GlobalOptions{WorkingDir: testFolder, ...}) inside the t.Run closure and
use that local instance in calls that currently rely on the package-global, or
assign the package-global once from that local before invoking the code under
test. Update uses of global in TestDryRun sub-tests to reference the new local
variable (or set global = local at the start of the subtest) so each sub-test
has its own independent GlobalOptions.

In `@internal/pkg/cli/dryrun.go`:
- Around line 77-91: Adjust generateClusterResourcesForDryRun so
cluster-resource generator failures are logged as warnings instead of returning
errors: for IDMS_ITMSGenerator, CatalogSourceGenerator, ClusterCatalogGenerator,
and UpdateServiceGenerator catch errors from their calls, call o.Log.Warnf with
a descriptive message and continue (mirroring the existing treatment of
GenerateSignatureConfigMap), and return nil at the end unless a
non-cluster-resource fatal condition occurs; also remove the if
o.ClusterResources == nil guard and update tests to inject MockClusterResources
(e.g., in TestDryRun) so production code no longer compensates for test setup.
🪄 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: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: e0215fdc-bd4e-4be5-9a4a-e764c5506b54

📥 Commits

Reviewing files that changed from the base of the PR and between ca5eebd and 73fa5c4.

📒 Files selected for processing (2)
  • internal/pkg/cli/dryrun.go
  • internal/pkg/cli/dryrun_test.go

Comment thread internal/pkg/cli/dryrun_test.go Outdated
Comment thread internal/pkg/cli/dryrun.go Outdated
Comment thread internal/pkg/cli/dryrun.go Outdated
@aguidirh

aguidirh commented May 8, 2026

Copy link
Copy Markdown
Contributor

@javipolo could you please have a look on the codeRabbit suggestions and also the linter job that is failing?

@javipolo javipolo force-pushed the dry-run-cluster-resources branch 2 times, most recently from 550eb67 to 629bba3 Compare May 11, 2026 15:24
@javipolo

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 11, 2026

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@javipolo

Copy link
Copy Markdown
Member Author

@javipolo could you please have a look on the codeRabbit suggestions and also the linter job that is failing?

@aguidirh done :)

Comment thread internal/pkg/cli/dryrun.go Outdated
Comment thread internal/pkg/cli/dryrun.go Outdated
Comment thread internal/pkg/cli/dryrun.go Outdated
Comment thread internal/pkg/cli/dryrun.go Outdated
Comment thread internal/pkg/cli/dryrun.go Outdated

@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.

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)
internal/pkg/cli/dryrun.go (1)

63-69: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Guard o.ClusterResources before generator calls.

generateClusterResources dereferences o.ClusterResources unconditionally. In non-M2D dry-run, an uninitialized generator will panic instead of returning a controlled error.

Proposed fix
 func (o *ExecutorSchema) generateClusterResources(ctx context.Context, allImages []v2alpha1.CopyImageSchema) error {
+	if o.ClusterResources == nil {
+		return fmt.Errorf("cluster resources generator is not initialized")
+	}
 	o.Log.Info(emoji.PageFacingUp + " Generating cluster resources...")
🤖 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 `@internal/pkg/cli/dryrun.go` around lines 63 - 69, generateClusterResources
currently dereferences o.ClusterResources without checking for nil which can
panic; add a guard at the start of generateClusterResources that checks if
o.ClusterResources is nil and return a controlled error (or wrap with context)
before calling any generator methods such as IDMS_ITMSGenerator (and any other
generator methods on ClusterResources) so the function fails gracefully when the
generator is uninitialized.
🤖 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 `@internal/pkg/cli/dryrun_test.go`:
- Around line 147-153: The test uses t.Errorf for unrecoverable setup failures
(the storage cache init and the registry.NewRegistry call), which allows the
test to continue with invalid state; replace those t.Errorf calls with t.Fatalf
so the test aborts immediately on these setup errors—specifically update the
error checks around the storage cache initialization and the
registry.NewRegistry(...) invocation to call t.Fatalf with the error message
instead of t.Errorf.

---

Outside diff comments:
In `@internal/pkg/cli/dryrun.go`:
- Around line 63-69: generateClusterResources currently dereferences
o.ClusterResources without checking for nil which can panic; add a guard at the
start of generateClusterResources that checks if o.ClusterResources is nil and
return a controlled error (or wrap with context) before calling any generator
methods such as IDMS_ITMSGenerator (and any other generator methods on
ClusterResources) so the function fails gracefully when the generator is
uninitialized.
🪄 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: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: b8cbcf9c-1db0-4e55-8c3f-3de6b7951298

📥 Commits

Reviewing files that changed from the base of the PR and between 629bba3 and c4097c5.

📒 Files selected for processing (2)
  • internal/pkg/cli/dryrun.go
  • internal/pkg/cli/dryrun_test.go

Comment thread internal/pkg/cli/dryrun_test.go
@javipolo javipolo force-pushed the dry-run-cluster-resources branch 3 times, most recently from c64b6bf to ed32fdf Compare May 20, 2026 18:26

@aguidirh aguidirh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the changes, it is in a much better shape now!

I've added few comments.

Comment thread internal/pkg/cli/dryrun.go Outdated
Comment thread internal/pkg/cli/dryrun.go Outdated
Comment thread internal/pkg/cli/dryrun_test.go Outdated
Comment thread internal/pkg/cli/dryrun_test.go Outdated

@adolfo-ab adolfo-ab left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the PR @javipolo !

The only thing that concerns me is that now we have some code duplication for the creation of cluster resources, which is also done in executor.go for m2m and d2m. Maybe we can encapsulate the code to generate the cluster resources into a function (your PR is already doing this part) and reuse them in the three places.

Maybe we can do this in a follow-up PR, for the sake of not blocking this PR much longer. Wdyt @aguidirh @r4f4 @dorzel ?

Comment thread internal/pkg/cli/dryrun.go Outdated
Comment thread internal/pkg/cli/dryrun_test.go Outdated
@javipolo

javipolo commented Jun 1, 2026

Copy link
Copy Markdown
Member Author

Thanks for the changes, it is in a much better shape now!

I've added few comments.

Thanks!

I addressed all the comments. Please take another look when you can!

@javipolo

javipolo commented Jun 1, 2026

Copy link
Copy Markdown
Member Author

Thanks for the PR @javipolo !

The only thing that concerns me is that now we have some code duplication for the creation of cluster resources, which is also done in executor.go for m2m and d2m. Maybe we can encapsulate the code to generate the cluster resources into a function (your PR is already doing this part) and reuse them in the three places.

Maybe we can do this in a follow-up PR, for the sake of not blocking this PR much longer. Wdyt @aguidirh @r4f4 @dorzel ?

Thanks a lot for the review!
I tried to remove the code duplication in a separate commit. Please see if you like how it's done :)

@javipolo javipolo requested a review from aguidirh June 1, 2026 13:37
Comment thread internal/pkg/cli/executor.go Outdated
Comment thread internal/pkg/cli/executor.go Outdated
Comment thread internal/pkg/cli/dryrun.go Outdated
Comment thread internal/pkg/cli/executor.go
Comment thread internal/pkg/cli/executor.go Outdated
Comment thread internal/pkg/cli/executor.go Outdated
Comment thread internal/pkg/cli/executor.go Outdated
Comment thread internal/pkg/cli/executor.go Outdated
Comment thread internal/pkg/cli/executor.go Outdated
Comment thread internal/pkg/cli/executor.go Outdated
@javipolo javipolo force-pushed the dry-run-cluster-resources branch from 40c99d2 to 6831ba3 Compare June 16, 2026 13:13
@javipolo

Copy link
Copy Markdown
Member Author

/retest

Comment thread internal/pkg/cli/dryrun.go
Comment thread internal/pkg/cli/executor.go Outdated
@javipolo

Copy link
Copy Markdown
Member Author

/retest

@aguidirh

Copy link
Copy Markdown
Contributor

@javipolo please squash the commits and I will approve it.

Don't worry about /test v1-e2e for now, it is a flaky test that we are fixing right now.

@javipolo javipolo force-pushed the dry-run-cluster-resources branch from 4654081 to f915d4e Compare June 17, 2026 13:50
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 17, 2026
@openshift-cherrypick-robot

Copy link
Copy Markdown

@aguidirh: once the present PR merges, I will cherry-pick it on top of release-4.22 in a new PR and assign it to you.

Details

In response to this:

/cherry-pick release-4.22

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@adolfo-ab adolfo-ab left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 26, 2026
Comment thread internal/pkg/cli/dryrun_test.go Outdated
Comment thread internal/pkg/cli/dryrun_test.go Outdated
Comment thread internal/pkg/cli/dryrun_test.go Outdated
Comment thread internal/pkg/cli/dryrun_test.go Outdated
Comment thread internal/pkg/cli/dryrun_test.go Outdated
Comment thread internal/pkg/cli/dryrun_test.go Outdated
Comment thread internal/pkg/cli/dryrun_test.go Outdated
Comment thread internal/pkg/cli/dryrun_test.go Outdated
Comment thread internal/pkg/cli/dryrun_test.go Outdated
Comment thread internal/pkg/cli/dryrun_test.go Outdated
@r4f4

r4f4 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Was the message

if len(imagesAvailable) > 0 {
      o.Log.Info("all %d images required for mirroring are available in local cache. You may proceed with mirroring from disk to disconnected registry", len(imagesAvailable))
  }

removed on purpose?

@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Jun 26, 2026
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
{}

@javipolo

Copy link
Copy Markdown
Member Author

Was the message

if len(imagesAvailable) > 0 {
      o.Log.Info("all %d images required for mirroring are available in local cache. You may proceed with mirroring from disk to disconnected registry", len(imagesAvailable))
  }

removed on purpose?

nope. I guess with the refactor it just went away ... I added it back

Please have a look

I also included all your suggestions to the test file

@javipolo javipolo force-pushed the dry-run-cluster-resources branch from 8e9402e to 828eada Compare June 26, 2026 11:30
@r4f4

r4f4 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 26, 2026
Signed-off-by: Javi Polo <jpolo@redhat.com>
@javipolo javipolo force-pushed the dry-run-cluster-resources branch from 828eada to 9b8ad50 Compare June 26, 2026 12:38
@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Jun 26, 2026
@r4f4

r4f4 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 26, 2026
@javipolo

Copy link
Copy Markdown
Member Author

/retest

@openshift-ci

openshift-ci Bot commented Jun 26, 2026

Copy link
Copy Markdown

@javipolo: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@aguidirh

Copy link
Copy Markdown
Contributor

/assign @nidangavali since @r4f4 already finished his code review.

@nidangavali

Copy link
Copy Markdown
Contributor

/verified by @nidangavali

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Jun 29, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@nidangavali: This PR has been marked as verified by @nidangavali.

Details

In response to this:

/verified by @nidangavali

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-merge-bot openshift-merge-bot Bot merged commit c3552e2 into openshift:main Jun 29, 2026
9 checks passed
@openshift-ci-robot

Copy link
Copy Markdown

@javipolo: Jira Issue Verification Checks: Jira Issue OCPBUGS-90096
✔️ This pull request was pre-merge verified.
✔️ All associated pull requests have merged.
✔️ All associated, merged pull requests were pre-merge verified.

Jira Issue OCPBUGS-90096 has been moved to the MODIFIED state and will move to the VERIFIED state when the change is available in an accepted nightly payload. 🕓

Details

In response to this:

Description

Create cluster-resource manifests while running with --dry-run flag

Github / Jira issue:

https://redhat.atlassian.net/browse/RFE-4107

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Run oc-mirror with --dry-run and manifests should apear in working-dir/cluster-resources
It was tested manually

Expected Outcome

Manifests should be present in cluster-resources directory

Summary by CodeRabbit

  • New Features

  • Dry-run now writes image mapping output immediately, always logs its path, and creates a missing-image report only when missing images are detected. Cluster resource generation is skipped when mirroring to disk; otherwise IDMS/ITMS, catalog manifests and signature ConfigMap are produced. UpdateService is generated when graph/release images are resolvable.

  • Tests

  • Refactored/expanded dry-run tests into table-driven cases validating mapping output, missing-image handling, conditional cluster-resources, catalog manifests, and UpdateService content.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-cherrypick-robot

Copy link
Copy Markdown

@aguidirh: new pull request created: #1457

Details

In response to this:

/cherry-pick release-4.22

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci

openshift-ci Bot commented Jun 29, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adolfo-ab, aguidirh, javipolo, nidangavali

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@javipolo javipolo deleted the dry-run-cluster-resources branch July 2, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants