Skip to content

Commit

Permalink
feat(fleet): extract dependencies from helm blocks without a fixed re…
Browse files Browse the repository at this point in the history
…leaseName (#28325)
  • Loading branch information
webD97 committed Apr 10, 2024
1 parent 0d79286 commit 7669f2f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
7 changes: 6 additions & 1 deletion lib/modules/manager/fleet/__fixtures__/valid_fleet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,9 @@ helm:
releaseName: logging-operator
version: 3.17.7
values:

---
defaultNamespace: monitoring
helm:
repo: https://prometheus-community.github.io/helm-charts
chart: prometheus
version: 25.19.1
9 changes: 9 additions & 0 deletions lib/modules/manager/fleet/extract.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ kind: Fleet
registryUrls: ['https://kubernetes-charts.banzaicloud.com'],
depType: 'fleet',
},
{
currentValue: '25.19.1',
datasource: 'helm',
depName: 'prometheus',
registryUrls: [
'https://prometheus-community.github.io/helm-charts',
],
depType: 'fleet',
},
]);
});

Expand Down
7 changes: 2 additions & 5 deletions lib/modules/manager/fleet/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@ const FleetHelmBlock = z.object({
chart: z.string().optional(),
repo: z.string().optional(),
version: z.string().optional(),
releaseName: z.string().optional(),
});
export type FleetHelmBlock = z.infer<typeof FleetHelmBlock>;

const FleetFileHelm = FleetHelmBlock.extend({
releaseName: z.string(),
});

/**
Represent a GitRepo Kubernetes manifest of Fleet.
@link https://fleet.rancher.io/gitrepo-add/#create-gitrepo-instance
Expand All @@ -32,7 +29,7 @@ export type GitRepo = z.infer<typeof GitRepo>;
@link https://fleet.rancher.io/gitrepo-structure/#fleetyaml
*/
export const FleetFile = z.object({
helm: FleetFileHelm,
helm: FleetHelmBlock,
targetCustomizations: z
.array(
z.object({
Expand Down

0 comments on commit 7669f2f

Please sign in to comment.