postgres-containers icon indicating copy to clipboard operation
postgres-containers copied to clipboard

Renovate config for standard images

Open srkoster opened this issue 4 months ago • 7 comments

I have migrated a first cluster to the standard image ghcr.io/cloudnative-pg/postgresql:17.5-202507210807-standard-bookworm

Today a new version was published 17.5-202507280807-standard-bookworm but it wasn't picked up by my Renovate job.

I have been struggling all evening but have failed to create a new working Renovate config for these new images. Did anybody succeed?

Here's my old customManager which worked for the legacy syntax.

{
  $schema: 'https://docs.renovatebot.com/renovate-schema.json',
  customManagers: [
    {
           customType: 'regex',
           description: ["Process CloudnativePG Postgresql version"],
           fileMatch: ["(^|/)kubernetes/.+\\.ya?ml$"],
           matchStrings: ["imageName: (?<depName>ghcr\\.io/cloudnative-pg/postgresql):(?<currentValue>.*\\-.*)"],
           datasourceTemplate: 'docker',
           versioningTemplate: 'redhat'
    }
  ]
}

srkoster avatar Jul 28 '25 20:07 srkoster

I'm also very interested. The new scheme used is interesting but hard to configure.

davinkevin avatar Sep 12 '25 14:09 davinkevin

Just started also looking into it and I think it doesn't pick it up because of the versioningTemplate. It seems that redhat versioning doesn't support multiple -

I think the best idea is to use a custom regex for versioning. I'll try to come up with something 🙂

DerRockWolf avatar Sep 20 '25 18:09 DerRockWolf

This works 🥳

{
  // cloudnative-pg instance version
  customType: 'regex',
  managerFilePatterns: [
    '/\\.yaml$/',
  ],
  matchStrings: [
    'imageName: (?<depName>\\S+):(?<currentValue>.*\\-.*)@(?<currentDigest>sha256:[a-f0-9]+)',
  ],
  datasourceTemplate: 'docker',
  // matches: 17.6-202509151215-standard-trixie
  versioningTemplate: 'regex:^(?<major>\\d+)\\.(?<minor>\\d+)-(?<patch>\\d+)-(?<compatibility>.*)$',
},

(The actual important thing is the versioningTemplate)

Keep in mind that updating to a newer debian release must be done manually, as renovate will never touch the "compatibility" part of the version string.

DerRockWolf avatar Sep 20 '25 20:09 DerRockWolf

do you want to add it to the README or add it as a file to project as a contribution?

gbartolini avatar Sep 22 '25 15:09 gbartolini

Thanks @DerRockWolf , this does indeed work!

@gbartolini I would suggest to put it into the README

srkoster avatar Sep 22 '25 19:09 srkoster

I am reopening so that @DerRockWolf can propose a PR.

gbartolini avatar Sep 24 '25 08:09 gbartolini

Done 🙂 https://github.com/cloudnative-pg/postgres-containers/pull/330

DerRockWolf avatar Sep 27 '25 16:09 DerRockWolf