Uploaded image for project: 'Red Hat Developer Hub Bugs'
  1. Red Hat Developer Hub Bugs
  2. RHDHBUGS-2736

Can't install OCI plugin if ref contains both registry hostname and port due to wrong parsing errors

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 1.9.0
    • Dynamic Plugins, Plugins
    • None
    • False
    • Hide

      None

      Show
      None
    • False

      Description of problem:

      Looks like the install-dynamic-plugins.py script parses and validates plugins OCI refs, but does not catch the host:port format, which may be common in certain environments where the registry is not exposed over a standard HTTP(S) port.

      Prerequisites (if any, like setup, operators/versions):

      RHDH `next` image (1.10)

      Steps to Reproduce

      Example OCI reference:

      oci://registry.localhost:5000/rhdh-plugins/rhdh-plugin-export-overlays/backstage-community-plugin-scaffolder-backend-module-quay:bs_1.45.3__2.14.0
      

      Actual results:

      Validation error in the init container:

      ======= Adding new dynamic plugin configuration for ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-quickstart
      Traceback (most recent call last):
        File "/opt/app-root/src/install-dynamic-plugins.py", line 1284, in <module>
          main()
        File "/opt/app-root/src/install-dynamic-plugins.py", line 1227, in main
          merge_plugin(plugin, all_plugins, include, level=0)
        File "/opt/app-root/src/install-dynamic-plugins.py", line 140, in merge_plugin
          return OciPackageMerger(plugin, dynamic_plugins_file, all_plugins).merge_plugin(level)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/opt/app-root/src/install-dynamic-plugins.py", line 585, in merge_plugin
          plugin_key, version, inherit_version, resolved_path = self.parse_plugin_key(package)
                                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/opt/app-root/src/install-dynamic-plugins.py", line 504, in parse_plugin_key
      
      ======= Cleaning up temporary catalog index directory
          raise InstallException(f"oci package \'{package}\' is not in the expected format \'{OCI_PROTOCOL_PREFIX}<registry>:<tag>\' or \'{OCI_PROTOCOL_PREFIX}<registry>@sha<algo>:<digest>\' (optionally followed by \'!<path>\') in {self.dynamic_plugins_file} where <algo> is one of {RECOGNIZED_ALGORITHMS}")
      InstallException: oci package 'oci://registry.localhost:5000/rhdh-plugins/rhdh-plugin-export-overlays/backstage-community-plugin-scaffolder-backend-module-quay:bs_1.45.3__2.14.0' is not in the expected format 'oci://<registry>:<tag>' or 'oci://<registry>@sha<algo>:<digest>' (optionally followed by '!<path>') in /dynamic-plugins-root/.catalog-index-temp/dynamic-plugins.default.yaml where <algo> is one of ('sha512', 'sha384', 'sha256')
      ======= Removed lock file: /dynamic-plugins-root/install-dynamic-plugins.lock
      

      Expected results:

      Should pass validation, as a registry may not necessarily be exposed over a standard HTTP(S) port.

      Reproducibility (Always/Intermittent/Only Once):

      Always

      Build Details:

      Additional info (Such as Logs, Screenshots, etc):

              Unassigned Unassigned
              rh-ee-asoro Armel Soro
              RHDH Plugins
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: