[patch] Pin CLI image versions in gitops Job templates #254
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://jsw.ibm.com/browse/MASCORE-5516
Define
$_cli_image_tag
as a constant in each Job file.This needs to be taken into account when computing the name of the job (since the image field is immutable) - so it is included when computing the hash we suffix to job names.
Because computing job names is getting quite complex, this PR also pulls out
$_job_name_prefix
,$_job_config_values
and$_job_version
constants and uses them to compute$_job_hash
and$_job_name
in a standardised manner.Having these constants and calculations defined in a standardised way makes scripting the process of updating them (e.g. updating all
$_cli_image_tag
values across the templates) and validating them (e.g. in a git precommit hook or git action to check for conformance to the convention) feasible.Note: to shorten job names, the
$_job_version
is now bundled into theadler32
sum rather than being embedde verbatim into the job name.So far PR only shows changes for one of the Jobs, but the idea is to replicate this structure in all.
Also to follow soon is a script for updating
$_cli_image_tag
in all templates, and a script of some sort for validating that all Job definitions conform to the conventions introduced by this PR.Note: adopting a gitops release with the changes in this PR will cause all Jobs to rerun in all environments.