build-helm-charts.sh can't handle image records using hostnames with hyphens or ports

Bug #1860465 reported by Joseph Richard
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Medium
Joseph Richard

Bug Description

When building helm charts with the image-record option passed in, the script will update the generated manifest to replace the image version with that of the image record.
The code to do this for each image record works by looking through all images in the manifest, and replacing any that match an old_image_reference for that record with a new image_reference that contains the image_record.

This currently does not work when an image record contains a hostname that has a hyphen in it, or that contains a hostname:port.

old_image_reference="\([a-zA-Z0-9.]*\|[0-9.:]*\)\/.*${image_name}:.*"
should be
old_image_reference="\([a-zA-Z0-9.:-]*\|[0-9.:]*\)\/.*${image_name}:.*"

Ghada Khalil (gkhalil)
Changed in starlingx:
assignee: nobody → Joseph Richard (josephrichard)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to root (master)

Reviewed: https://review.opendev.org/703659
Committed: https://git.openstack.org/cgit/starlingx/root/commit/?id=6cadc457483c7ce194e1f2f58f07cc3434eb20a7
Submitter: Zuul
Branch: master

commit 6cadc457483c7ce194e1f2f58f07cc3434eb20a7
Author: Joseph Richard <email address hidden>
Date: Tue Jan 21 12:08:40 2020 -0500

    Update old_image_reference regex

    This commit updates the old_image_reference regex to correctly handle
    images records using a hostname with hyphens and/or a port specified.

    Closes-bug: 1860465
    Change-Id: Ibf88d1c675277d4b133d0fd68029555ceea3e18d
    Signed-off-by: Joseph Richard <email address hidden>

Changed in starlingx:
status: In Progress → Fix Released
Revision history for this message
Ghada Khalil (gkhalil) wrote :

stx.4.0 / medium priority - issue w/ build-helm-charts for a specific scenario

Changed in starlingx:
importance: Undecided → Medium
tags: added: stx.4.0 stx.containers
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to root (f/centos8)

Fix proposed to branch: f/centos8
Review: https://review.opendev.org/705827

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to root (f/centos8)
Download full text (5.4 KiB)

Reviewed: https://review.opendev.org/705827
Committed: https://git.openstack.org/cgit/starlingx/root/commit/?id=b7abdd160cc11bb86bdb876db0230b9f5160eccd
Submitter: Zuul
Branch: f/centos8

commit b864e153ddac995cb111b583a9d9e0c58a567387
Author: Don Penney <email address hidden>
Date: Tue Jan 21 17:04:10 2020 -0500

    Support source patches for building images

    The build-stx-images.sh allows for building images using a git repo as
    the source, which is cloned into the workspace as part of the build
    procedure. In some cases, there may be source changes required for
    fixes or enhancements that have not yet merged into the referenced
    repo. This update adds support in build-stx-images to allow the
    designer to specify patches in the image directives file, which will
    be applied after cloning.

    Designer workflow:
    * clone git repo (may need to apply any existing git patches from
    previous fixes)
    * make changes
    * commit, with a beautiful and admirable commit message
    * git format-patch
    * copy source patch to stx repo, somewhere alongside the docker_image
    directives file (ie. a docker_patches dir)
    * update docker_image directives file to add DOCKER_REPO_PATCHES or
    SOURCE_PATCHES, as appropriate, with DOCKER_REF or SOURCE_REF set to
    the current upstream SHA used as the base for the patch

    Story: 2006711
    Task: 38499
    Change-Id: Icac2b4dc2ebeb32946de6e5adcbf59a10c56a30c
    Signed-off-by: Don Penney <email address hidden>

commit 6cadc457483c7ce194e1f2f58f07cc3434eb20a7
Author: Joseph Richard <email address hidden>
Date: Tue Jan 21 12:08:40 2020 -0500

    Update old_image_reference regex

    This commit updates the old_image_reference regex to correctly handle
    images records using a hostname with hyphens and/or a port specified.

    Closes-bug: 1860465
    Change-Id: Ibf88d1c675277d4b133d0fd68029555ceea3e18d
    Signed-off-by: Joseph Richard <email address hidden>

commit e443a2c736e891226bcd2f5b08ade79a3aceaf02
Author: Lin Shuicheng <email address hidden>
Date: Sun Jan 19 01:15:50 2020 +0000

    Revert "Revert "add kata rpms to ISO""

    This reverts commit 4c7595db02ac250cdf8f04fd49df7a401c8bfb7e.

    Depends-On: https://review.opendev.org/703263

    Change-Id: Iefc0bafb369e3897e1028b33c45303d18f93a24b
    Signed-off-by: Shuicheng Lin <email address hidden>

commit 31aea8e88b2f0e2fe90e3b802a2ffff3c230b212
Author: John Kung <email address hidden>
Date: Thu Jan 16 16:03:27 2020 -0500

    Allow application to specify app_name in metadata

    Update build-helm-charts to allow application to optionally specify app_name.
    The script was ignoring app_name if it was already specified in the metadata;
    this updates it to accept the app_name if specified, otherwise default to
    APP_NAME as specified in command line for the tarball.

    Change-Id: I9368b3a8a7c3d50981f02fe7c4a5e4be8255cfc3
    Partial-Bug: 1859882
    Signed-off-by: John Kung <email address hidden>

commit b5bfa6087e7e131fdff107029f33fb46205e0884
Author: Don Penney <email address hidden>
Date: Wed Jan 15 23...

Read more...

tags: added: in-f-centos8
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.