cannot download k8s image if using registry with port

Bug #1847409 reported by Lin Shuicheng
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
High
Angie Wang

Bug Description

Brief Description
-----------------
Cannot deploy latest master ISO successfully if using private registry with port declared in address.
Such as "edgehost.intel.com:5000" as private registry. It will cause docker tag cmd fail, then lead to download failure.

Severity
--------
Provide the severity of the defect.
Critical: System/Feature is not usable due to the defect

Steps to Reproduce
------------------
1. Use master ISO after 9/26.
2. Deploy iso with private registry with port number in address.
3. Deploy will fail at ansible playbook when run "Download images and push to local registry"

It is caused by https://review.opendev.org/686057
In download_images.py, it will tag original img directly to registry.local.

So for image from private registry it will be like this:
docker tag edgehost01.sh.intel.com:5000/k8s.gcr.io/kube-apiserver:v1.16.0 edgehost01.sh.intel.com:5000/edgehost01.sh.intel.com:5000/kube-apiserver:v1.16.0
And it will cause docker error like below:
Error parsing reference: "edgehost01.sh.intel.com:5000/edgehost01.sh.intel.com:5000/kube-apiserver:v1.16.0" is not a valid repository/tag: invalid reference format

Expected Behavior
------------------
Deploy should success.

Actual Behavior
----------------
Deploy will fail at ansible playbook when run "Download images and push to local registry"

Reproducibility
---------------
100%

System Configuration
--------------------
AIO

Branch/Pull Time/Commit
-----------------------
Code including https://review.opendev.org/686057

Last Pass
---------
Code before https://review.opendev.org/686057

Timestamp/Logs
--------------

Test Activity
-------------
Sanity

Ghada Khalil (gkhalil)
Changed in starlingx:
assignee: nobody → Angie Wang (angiewang)
Angie Wang (angiewang)
Changed in starlingx:
status: New → In Progress
Revision history for this message
Ghada Khalil (gkhalil) wrote :

Marking as stx.3.0 / high priority - issue introduced by recent code changes

Changed in starlingx:
importance: Undecided → High
tags: added: stx.3.0 stx.containers
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ansible-playbooks (master)

Fix proposed to branch: master
Review: https://review.opendev.org/687655

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to stx-puppet (master)

Fix proposed to branch: master
Review: https://review.opendev.org/687656

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ansible-playbooks (master)

Reviewed: https://review.opendev.org/687655
Committed: https://git.openstack.org/cgit/starlingx/ansible-playbooks/commit/?id=67a19b2799cdc5a5f88f7f44d376cd1196df0083
Submitter: Zuul
Branch: master

commit 67a19b2799cdc5a5f88f7f44d376cd1196df0083
Author: Angie Wang <email address hidden>
Date: Wed Oct 9 13:37:53 2019 -0400

    Strip out port from the alternative registry url

    All system images were changed to push to local registry.
    The image reference conversion approach(local registry
    prepended) is:
    registry.local:9001/<public/private-registry>/image:tag

    In the case that private registry contains a port, we need
    to strip it out as Docker does not allow the format of the
    image reference that has port in repositores/namespaces,
    otherwise, the image reference conversion will fail.

    Test conducted (AIO-DX):
      - deploy system with private registry that has port in address
      - deploy system with public registry

    Change-Id: I1e3867dde932b60dd2e7f0a42331a7c12aaba752
    Closes-Bug: #1847409
    Signed-off-by: Angie Wang <email address hidden>

Changed in starlingx:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to stx-puppet (master)

Reviewed: https://review.opendev.org/687656
Committed: https://git.openstack.org/cgit/starlingx/stx-puppet/commit/?id=7b4a4c8da4794b5bc472ef83ff8121331d9691c1
Submitter: Zuul
Branch: master

commit 7b4a4c8da4794b5bc472ef83ff8121331d9691c1
Author: Angie Wang <email address hidden>
Date: Wed Oct 9 13:25:46 2019 -0400

    Strip out port from the alternative registry url

    If the alternative registry url contains a port, it's
    stripped out during Ansible bootstrap. Strip it out
    at puppet side too.

    Change-Id: I98b3564da838a0900a720e6bd7f3fb8b8670f111
    Depends-On: https://review.opendev.org/687655
    Closes-Bug: #1847409
    Signed-off-by: Angie Wang <email address hidden>

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to config (master)

Fix proposed to branch: master
Review: https://review.opendev.org/688020

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.opendev.org/688158

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to config (master)

Reviewed: https://review.opendev.org/688158
Committed: https://git.openstack.org/cgit/starlingx/config/commit/?id=0c6f262978cd700f245e2b6a1ad6e59d7431ad4f
Submitter: Zuul
Branch: master

commit 0c6f262978cd700f245e2b6a1ad6e59d7431ad4f
Author: Angie Wang <email address hidden>
Date: Fri Oct 11 11:56:42 2019 -0400

    Strip out port from the alternative registry url

    If the alternative registry url contains a port, it's
    stripped out during Ansible bootstrap. Strip it out
    from armada image too.

    Tested:
      - apply application successfully with private registry
        that has port in the address

    Depends-On: https://review.opendev.org/687655
    Change-Id: I12814790f0c61247704dbf4f55a7e6620ec5849e
    Closes-Bug: #1847409
    Signed-off-by: Angie Wang <email address hidden>

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on config (master)

Change abandoned by Lin Shuicheng (<email address hidden>) on branch: master
Review: https://review.opendev.org/688020

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.