5.4. Guidelines for container image tagging
When you prepare image containers in your containers-prepare-parameter.yaml file, you use parameters to determine which container image director pulls when updating your environment, as described in Container image preparation parameters. The Red Hat Container Registry uses a specific version format to tag all Red Hat OpenStack Platform container images. This format follows the label metadata for each container, which is version-release:
- version
- Corresponds to a major and minor version of RHOSP. These versions act as streams that contain one or more releases.
- release
- Corresponds to a release of a specific container image version within a version stream.
For example, if the latest version of RHOSP is 17.1.0 and the release for the container image is 5.161, then the resulting tag for the container image is 17.1.0-5.161.
Major and minor version tags
The Red Hat Container Registry also uses a set of major and minor version tags that link to the latest release for that container image version. For example, both 17.1 and 17.1.0 link to the latest release in the 17.1.0 container stream. If a new minor release of 17.1 occurs, the 17.1 tag links to the latest release for the new minor release stream while the 17.1.0 tag continues to link to the latest release in the 17.1.0 stream.
Setting the tag and tag_from_label parameters
In your containers-prepare-parameter.yaml file, the ContainerImagePrepare parameter contains tag and tag_from_label sub-parameters. You can use tag or tag_from_label to determine which container image to download:
tag-
director uses
tagto pull an image only based on major or minor version tags, which the Red Hat Container Registry links to the latest image release within a version stream. tag_from_label-
director uses
tag_from_labelto perform a metadata inspection of each container image and generates a tag to pull the corresponding image.
The tag parameter always takes precedence over the tag_from_label parameter. To use tag_from_label, omit the tag parameter from your container preparation configuration.
Setting the tag parameter
The default value for tag is the major version for your RHOSP version, for example 17.1. This value always corresponds to the latest minor version and release.
parameter_defaults:
ContainerImagePrepare:
- set:
...
tag: 17.1
...
To change to a specific minor version for RHOSP container images, set the tag to a minor version. For example, to change to 17.1.2, set tag to 17.1.2.
parameter_defaults:
ContainerImagePrepare:
- set:
...
tag: 17.1.2
...
When you set tag, director always downloads the latest container image release for the version set in tag during installation and updates, including stack updates.
If you are doing a stack update, you might not want the latest container image but the container image that matches your environment. In this case, omit the tag parameter from your container preparation configuration and specify tag_from_label only. The tag_from_label parameter uses the installed RHOSP version to determine the value for the tag to use as part of the update process.
Setting the tag_from_label parameter
If you do not set tag, director uses the value of tag_from_label in conjunction with the latest major version.
parameter_defaults:
ContainerImagePrepare:
- set:
...
# tag: 17.1
...
tag_from_label: '{version}-{release}'
The tag_from_label parameter generates the tag from the label metadata of the latest container image release it inspects from the Red Hat Container Registry. For example, the labels for a certain container might use the following version and release metadata:
"Labels": {
"release": "5.161",
"version": "17.1.0",
...
}
The default value for tag_from_label is {version}-{release}, which corresponds to the version and release metadata labels for each container image. For example, if a container image has 17.1.0 set for version and 5.161 set for release, the resulting tag for the container image is 17.1.0-5.161.