feat(docs): add section about bumping Cluster imageName using renovate#330
Conversation
8cf8316 to
c3d2972
Compare
|
I've been running this against CNPG tags and hit two practical issues with the current snippet:
Also, it helps to add a Proposed doc snippet (drop-in): {
customManagers: [
{
// CloudNativePG Cluster imageName
customType: "regex",
description: ["Process CloudnativePG Postgresql version"],
managerFilePatterns: ["/\\.ya?ml(?:\\.j2)?$/"],
matchStrings: [
"imageName:\\s*(?<depName>[^:\\s#]+):(?<currentValue>[^@\\s#]+)(?:@(?<currentDigest>sha256:[A-Fa-f0-9]{64}))?"
],
datasourceTemplate: "docker",
versioningTemplate: "regex:^(?<major>\\d+)\\.(?<minor>\\d+)-(?<patch>\\d+)(?:-(?<compatibility>\\S+))?$",
replaceStringTemplate: "imageName: {{depName}}:{{newValue}}{{#if newDigest}}@{{newDigest}}{{/if}}"
}
]
}Why this is safer:
|
|
@acuntex although your answer smells quite a bit AI (correct me if I'm wrong) I'm still going to address a few points. Firstly, this PR just adds an example renovate manager, so if you need something more specific feel free to adjust it in your config. The official file extension is I adapted the regex so that the digest is optional. By the way, if you don't want to do the entire work on your own at least check that what the LLM spat out is correct. |
|
@DerRockWolf I grabbed an older custom manager from my own repo as inspiration and shared my notes here to improve the user experience for folks configuring Renovate with CNPG. |
0dd6f59 to
f61291d
Compare
f61291d to
356443c
Compare
b2a2d22 to
b27b577
Compare
…ovate Signed-off-by: RockWolf <git@rockwolf.eu>
Signed-off-by: RockWolf <git@rockwolf.eu>
Co-authored-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com> Signed-off-by: DerRockWolf <50499906+DerRockWolf@users.noreply.github.com>
Renovate replaces the full regex match with the rendered template, so the original template stripped the `imageName: ghcr.io/...:` prefix and produced invalid YAML. Including the prefix and `depName` in the template fixes the replacement while preserving the ability to pin a digest when one is not already present. Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Route PostgreSQL major updates through the dependency dashboard for human approval, and anchor the digest match to exactly 64 hex characters so malformed digests are no longer captured. Clarify the trailing prose: the `compatibility` segment pins image flavour and Debian base (not abstract "compatibility"), and switching the Debian base is a manual operation because of PostgreSQL locale-data implications. Note that the example uses JSON5 syntax and suggest narrowing `managerFilePatterns` when the user repository contains unrelated YAML. Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
d975fc9 to
63817c2
Compare
This regex manager example can be used by users of renovate that want to also automate updates of their CNPG clusters.
Resolves #257