Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[patch] Pin CLI image versions in gitops Job templates #254

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

tomklapiscak
Copy link
Contributor

@tomklapiscak tomklapiscak commented Feb 5, 2025

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 the adler32 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.

@tomklapiscak tomklapiscak marked this pull request as draft February 5, 2025 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant