You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OCPBUGS-73844: Let import mode be decided by the cluster when not specified
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.
cmd.Flags().BoolVar(&o.Confirm, "confirm", o.Confirm, "If true, allow the image stream import location to be set or changed")
130
129
cmd.Flags().BoolVar(&o.All, "all", o.All, "If true, import all tags from the provided source on creation or if --from is specified")
131
130
cmd.Flags().StringVar(&o.ReferencePolicy, "reference-policy", o.ReferencePolicy, "Allow to request pullthrough for external image when set to 'local'. Defaults to 'source'.")
132
-
cmd.Flags().StringVar(&o.ImportMode, "import-mode", o.ImportMode, "Imports the full manifest list of a tag when set to 'PreserveOriginal'. Defaults to 'Legacy'.")
131
+
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.")
133
132
cmd.Flags().BoolVar(&o.DryRun, "dry-run", o.DryRun, "Fetch information about images without creating or updating an image stream.")
134
133
cmd.Flags().BoolVar(&o.Scheduled, "scheduled", o.Scheduled, "Set each imported container image to be periodically imported from a remote repository. Defaults to false.")
135
134
cmd.Flags().BoolVar(&o.Insecure, "insecure", o.Insecure, "If true, allow importing from registries that have invalid HTTPS certificates or are hosted via HTTP. This flag will take precedence over the insecure annotation.")
@@ -218,7 +217,8 @@ func (o *ImportImageOptions) Validate() error {
218
217
casestring(imagev1.ImportModeLegacy):
219
218
casestring(imagev1.ImportModePreserveOriginal):
220
219
case"":
221
-
o.ImportMode=string(imagev1.ImportModeLegacy)
220
+
// Leave empty and let it be decided based on the ClusterVersion's "desired.architecture" value. If the value is "Multi",
221
+
// the import mode is set to "PreserveOriginal", if not it is set to "Legacy"
222
222
default:
223
223
returnfmt.Errorf("valid ImportMode values are %s or %s", imagev1.ImportModeLegacy, imagev1.ImportModePreserveOriginal)
0 commit comments