Description of problem:
When attempting to import an image with BYON where the image registry contains a port number, BYON creates the field spec.tags[0].name as the value after the port number.
For example, if importing the following url:
my-registery:1234/my-org/my-image:latest
BYON will create a tag with the name as this:
1234/my-org/my-image
When attempting to start that notebook, the pod throws an "InvalidImageName" error because the slashes are not valid in a tag name.
Prerequisites (if any, like setup, operators/versions):
Steps to Reproduce
Create a new BYON entry using a registry that requires the port number to be included, such as the OpenShift internal image registry service URL. For example:
image-registry.openshift-image-registry.svc:5000/redhat-ods-applications/s2i-minimal-notebook:2023.1
Actual results:
The dashboard creates the following object with the tag name of 5000/redhat-ods-applications/s2i-minimal-notebook:
kind: ImageStream apiVersion: image.openshift.io/v1 metadata: annotations: opendatahub.io/notebook-image-creator: troyer opendatahub.io/notebook-image-desc: Do not use opendatahub.io/notebook-image-messages: '' opendatahub.io/notebook-image-name: test-notebook opendatahub.io/notebook-image-origin: Admin opendatahub.io/notebook-image-phase: Succeeded opendatahub.io/notebook-image-url: >- image-registry.openshift-image-registry.svc:5000/redhat-ods-applications/s2i-minimal-notebook:2023.1 name: byon-1686232954777 namespace: redhat-ods-applications labels: app.kubernetes.io/created-by: byon opendatahub.io/dashboard: 'true' opendatahub.io/notebook-image: 'true' spec: lookupPolicy: local: true tags: - name: 5000/redhat-ods-applications/s2i-minimal-notebook annotations: opendatahub.io/notebook-python-dependencies: '[]' opendatahub.io/notebook-software: '[]' openshift.io/imported-from: >- image-registry.openshift-image-registry.svc:5000/redhat-ods-applications/s2i-minimal-notebook:2023.1 from: kind: DockerImage name: >- image-registry.openshift-image-registry.svc:5000/redhat-ods-applications/s2i-minimal-notebook:2023.1 generation: 2 importPolicy: importMode: Legacy referencePolicy: type: Source
Expected results:
I would expect the tag field to populate with 2023.1.
Reproducibility (Always/Intermittent/Only Once):
Always
Build Details:
Workaround:
Manually modify tag to a valid value