mirror of https://github.com/renovatebot/renovate
fix(manager/fleet): do not merge version into customization objects (#20223)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>pull/20228/head 34.124.1
parent
196ed35dcb
commit
5c5cde9d78
lib/modules/manager/fleet
|
@ -24,3 +24,17 @@ targetCustomizations:
|
|||
helm:
|
||||
version: "v1.8.2"
|
||||
repo: https://charts.example.com
|
||||
|
||||
---
|
||||
defaultNamespace: cert-manager
|
||||
helm:
|
||||
chart: cert-manager
|
||||
repo: https://charts.jetstack.io
|
||||
releaseName: custom-cert-manager
|
||||
version: v1.8.0
|
||||
values:
|
||||
installCRDs: true
|
||||
targetCustomizations:
|
||||
- name: cluster1
|
||||
values:
|
||||
some: customization
|
||||
|
|
|
@ -104,6 +104,22 @@ kind: Fleet
|
|||
registryUrls: ['https://charts.example.com'],
|
||||
depType: 'fleet',
|
||||
},
|
||||
{
|
||||
currentValue: 'v1.8.0',
|
||||
datasource: 'helm',
|
||||
depName: 'cert-manager',
|
||||
packageName: 'cert-manager',
|
||||
registryUrls: ['https://charts.jetstack.io'],
|
||||
depType: 'fleet',
|
||||
},
|
||||
{
|
||||
datasource: 'helm',
|
||||
depName: 'cluster1',
|
||||
packageName: 'cert-manager',
|
||||
registryUrls: ['https://charts.jetstack.io'],
|
||||
depType: 'fleet',
|
||||
skipReason: 'no-version',
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
|
|
|
@ -87,10 +87,15 @@ function extractFleetFile(doc: FleetFile): PackageDependency[] {
|
|||
result.push(extractFleetHelmBlock(doc.helm));
|
||||
|
||||
if (!is.undefined(doc.targetCustomizations)) {
|
||||
// remove version from helm block to allow usage of variables defined in the global block, but do not create PRs
|
||||
// if there is no version defined in the customization.
|
||||
const helmBlockContext: FleetHelmBlock = { ...doc.helm };
|
||||
delete helmBlockContext.version;
|
||||
|
||||
for (const custom of doc.targetCustomizations) {
|
||||
const dep = extractFleetHelmBlock({
|
||||
// merge base config with customization
|
||||
...doc.helm,
|
||||
...helmBlockContext,
|
||||
...custom.helm,
|
||||
});
|
||||
result.push({
|
||||
|
|
|
@ -28,7 +28,7 @@ export interface FleetFile {
|
|||
export interface FleetHelmBlock {
|
||||
chart: string;
|
||||
repo?: string;
|
||||
version: string;
|
||||
version?: string;
|
||||
}
|
||||
|
||||
export interface FleetFileHelm extends FleetHelmBlock {
|
||||
|
|
Loading…
Reference in New Issue