From add8c5ea8e332a443706b0f8ddbd05b32d65935b Mon Sep 17 00:00:00 2001
From: Michael Kriese <michael.kriese@visualon.de>
Date: Thu, 22 Aug 2024 13:23:25 +0200
Subject: [PATCH] feat(presets/workarounds): add `k3s-io/k3s` versioning
 (#30957)

---
 lib/config/presets/internal/workarounds.ts | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/lib/config/presets/internal/workarounds.ts b/lib/config/presets/internal/workarounds.ts
index 8c4441ecd3..815d864ec6 100644
--- a/lib/config/presets/internal/workarounds.ts
+++ b/lib/config/presets/internal/workarounds.ts
@@ -22,6 +22,7 @@ export const presets: Record<string, Preset> = {
       'workarounds:disableMavenParentRoot',
       'workarounds:containerbase',
       'workarounds:bitnamiDockerImageVersioning',
+      'workarounds:k3sKubernetesVersioning',
     ],
     ignoreDeps: [], // Hack to improve onboarding PR description
   },
@@ -168,6 +169,17 @@ export const presets: Record<string, Preset> = {
       },
     ],
   },
+  k3sKubernetesVersioning: {
+    description: 'Use custom regex versioning for k3s-io/k3s',
+    packageRules: [
+      {
+        matchDatasources: ['github-releases'],
+        matchPackageNames: ['k3s-io/k3s'],
+        versioning:
+          'regex:^v(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)(?:-(?<prerelease>[a-z]+\\d+))?(?<compatibility>\\+k3s)(?<build>\\d+)$',
+      },
+    ],
+  },
   mavenCommonsAncientVersion: {
     description: 'Fix some problems with very old Maven commons versions.',
     packageRules: [
-- 
GitLab