Skip to content

Conversation

@Prashanth684
Copy link
Contributor

Today, we default to "Legacy" importmode when no option is specified. With the introduction of
https://issues.redhat.com/browse/MULTIARCH-4552, the importmode is determined by the Cluster version's desired.architecture - which if set to "Multi", the import mode is PreserveOriginal else Legacy. Hence we don't need to default to Legacy all the time.

@openshift-ci-robot openshift-ci-robot added jira/severity-critical Referenced Jira bug's severity is critical for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jan 15, 2026
@openshift-ci-robot
Copy link

@Prashanth684: This pull request references Jira Issue OCPBUGS-73844, which is invalid:

  • expected the bug to target the "4.22.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Today, we default to "Legacy" importmode when no option is specified. With the introduction of
https://issues.redhat.com/browse/MULTIARCH-4552, the importmode is determined by the Cluster version's desired.architecture - which if set to "Multi", the import mode is PreserveOriginal else Legacy. Hence we don't need to default to Legacy all the time.

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.

@coderabbitai
Copy link

coderabbitai bot commented Jan 15, 2026

Walkthrough

Removed automatic defaulting of image ImportMode to "Legacy" across CLI commands and helpers; flag help texts updated to explain behaviors for PreserveOriginal, Legacy, and unspecified (cluster-determined) modes. Tests were updated to expect an empty ImportMode when unset.

Changes

Cohort / File(s) Summary
Import image CLI
pkg/cli/importimage/importimage.go
Removed default initialization of ImportMode in NewImportImageOptions; removed fallback to Legacy in Validate; updated --import-mode flag description to document Legacy, PreserveOriginal, and cluster-determined (unspecified) behaviors.
Import image tests
pkg/cli/importimage/importimage_test.go
Removed assertions expecting ImportModeLegacy in many test cases; replaced with empty TagImportPolicy{} where appropriate; preserved explicit PreserveOriginal/Legacy cases.
New app CLI
pkg/cli/newapp/newapp.go
Updated --import-mode flag help text to state behavior for Legacy, PreserveOriginal, and when unspecified (cluster determines).
New build CLI
pkg/cli/newbuild/newbuild.go
Updated --import-mode flag help text to state behavior for Legacy, PreserveOriginal, and when unspecified (cluster determines).
Tag CLI and tests
pkg/cli/tag/tag.go, pkg/cli/tag/tag_test.go
Updated --import-mode flag description; removed defaulting of empty importMode to Legacy in Validate; tests adjusted to expect empty importMode when unset.
Newapp helper
pkg/helpers/newapp/cmd/newapp.go
Stopped coercing empty ImportMode to ImportModeLegacy in AppConfig.Run(); left ImportMode empty with comment that cluster/version will determine final mode.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

✨ Finishing touches
  • 📝 Generate docstrings

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

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 15, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Prashanth684
Once this PR has been reviewed and has the lgtm label, please assign ardaguclu for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@xiuwang
Copy link

xiuwang commented Jan 16, 2026

/verified by @xiuwang

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Jan 16, 2026
@openshift-ci-robot
Copy link

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

Details

In response to this:

/verified by @xiuwang

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.

cmd.Flags().BoolVar(&o.All, "all", o.All, "If true, import all tags from the provided source on creation or if --from is specified")
cmd.Flags().StringVar(&o.ReferencePolicy, "reference-policy", o.ReferencePolicy, "Allow to request pullthrough for external image when set to 'local'. Defaults to 'source'.")
cmd.Flags().StringVar(&o.ImportMode, "import-mode", o.ImportMode, "Imports the full manifest list of a tag when set to 'PreserveOriginal'. Defaults to 'Legacy'.")
cmd.Flags().StringVar(&o.ImportMode, "import-mode", o.ImportMode, "Imports the full manifest list of a tag when set to 'PreserveOriginal'. When set to 'Legacy', imports a single sub-manifest. When unspecified, the cluster determines the import mode.")
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't this be a breaking change?. Because we implicitly change a default behavior. So people who rely on Legacy behavior by default will start getting failuıres?.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The default behavior will only change for clusters installed with the multi-arch payload, where the expectation is that images are manifestlisted. That being said, we should document that on multi-arch clusters, the default behavior is importing manifestlisted images and to get the legacy behavior, --import-mode=Legacy needs to be added.

@openshift-ci-robot openshift-ci-robot removed the verified Signifies that the PR passed pre-merge verification criteria label Jan 16, 2026
…cified

Today, we default to "Legacy" importmode when no option is specified.
With the introduction of
https://issues.redhat.com/browse/MULTIARCH-4552, the importmode is
determined by the Cluster version's `desired.architecture` - which if
set to "Multi", the import mode is PreserveOriginal else Legacy. Hence
we don't need to default to Legacy all the time.
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 17, 2026

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. jira/severity-critical Referenced Jira bug's severity is critical for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants