Update versions on all binaries#1973
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the release version from 0.17.3 to 0.19.0 across Helm values and deployment manifests. It also introduces an automated step in ops/gmpctl/prep-rc.sh to ensure versioned image tags match the release version in values.global.yaml. The reviewer suggested optimizing this script by batching the yq updates into a single go tool invocation rather than running it inside a loop, which improves execution speed.
| # Ensure versioned image tags match the release version. | ||
| for img in configReloader operator ruleEvaluator datasourceSyncer; do | ||
| echo "🔄 Ensuring v${CLEAN_TAG}-gke.0 on ${values_file} for ${img} tag..." | ||
| go tool -modfile="${DIR}/tools/go.mod" yq -i ".images.${img}.tag = \"v${CLEAN_TAG}-gke.0\"" "${values_file}" | ||
| done |
There was a problem hiding this comment.
Invoking go tool inside a loop can be quite slow because of the overhead of resolving and invoking the toolchain multiple times. We can optimize this by constructing a single yq expression and running go tool once, while still keeping the list of images clean and maintainable.
| # Ensure versioned image tags match the release version. | |
| for img in configReloader operator ruleEvaluator datasourceSyncer; do | |
| echo "🔄 Ensuring v${CLEAN_TAG}-gke.0 on ${values_file} for ${img} tag..." | |
| go tool -modfile="${DIR}/tools/go.mod" yq -i ".images.${img}.tag = \"v${CLEAN_TAG}-gke.0\"" "${values_file}" | |
| done | |
| # Ensure versioned image tags match the release version. | |
| yq_expr="" | |
| for img in configReloader operator ruleEvaluator datasourceSyncer; do | |
| if [[ -n "${yq_expr}" ]]; then | |
| yq_expr="${yq_expr} | " | |
| fi | |
| yq_expr="${yq_expr}.images.${img}.tag = \"v${CLEAN_TAG}-gke.0\"" | |
| done | |
| echo "🔄 Ensuring v${CLEAN_TAG}-gke.0 on ${values_file} for image tags..." | |
| go tool -modfile="${DIR}/tools/go.mod" yq -i "${yq_expr}" "${values_file}" |
References
- When proposing a code change, always use the GitHub 'suggestion' Markdown block and ensure it captures the correct lines. (link)
dabf288 to
10921df
Compare
0.19.0and the corresponding componentimage tags to
v0.19.0-gke.0incharts/values.global.yaml.manifests/operator.yaml,manifests/rule-evaluator.yaml,cmd/datasource-syncer/datasource-syncer.yaml)to propagate the new version.
ops/gmpctl/prep-rc.shto automatically align the componentimage tags (
configReloader,operator,ruleEvaluator,datasourceSyncer)with the release version in
values.global.yaml.