Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-33121

oc-mirror v2 allows the usage of wrong flags

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Normal Normal
    • None
    • 4.16.0
    • oc-mirror
    • No
    • CLID Sprint 254
    • 1
    • False
    • Hide

      None

      Show
      None
    • Hide
      Previously, in oc-mirror v2 (Technology Preview), there was no validation for the `-v2` vs `--v2` flags. As a result, users who mistakenly used `-v2`, that sets the log level to 2 instead of `--v2`, that switches to oc-mirror v2, encountered unclear error messages. With this update, flag validation is provided. If `-v2` is used while the `ImageSetConfig` is using the `v2alpha1` API and `--v2` is not specified, an error message is displayed. The following message is now enabled that provides a clear guidance to the user:

      [source,terminal]
      ----
      [ERROR]: Detected a v2 `ImageSetConfiguration`, please use `--v2` instead of `-v2`.
      ----
      (link:https://issues.redhat.com/browse/OCPBUGS-33121[*OCPBUGS-33121*])
      Show
      Previously, in oc-mirror v2 (Technology Preview), there was no validation for the `-v2` vs `--v2` flags. As a result, users who mistakenly used `-v2`, that sets the log level to 2 instead of `--v2`, that switches to oc-mirror v2, encountered unclear error messages. With this update, flag validation is provided. If `-v2` is used while the `ImageSetConfig` is using the `v2alpha1` API and `--v2` is not specified, an error message is displayed. The following message is now enabled that provides a clear guidance to the user: [source,terminal] ---- [ERROR]: Detected a v2 `ImageSetConfiguration`, please use `--v2` instead of `-v2`. ---- (link: https://issues.redhat.com/browse/OCPBUGS-33121 [* OCPBUGS-33121 *])
    • Bug Fix
    • Done

      With the current v2 implementation there is no validation on the flags, for example it is possible to use -v2 which is not valid. The valid is --v2 with double -

      So it is required to create a validation to check if the flags are valid if it is not present in cobra framework.

              luzuccar@redhat.com Luigi Mario Zuccarelli
              rh-ee-aguidi Alex Guidi
              ying zhou ying zhou
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: