Skip to content

Commit 9db036e

Browse files
authored
feat(helm): added helm options (#5)
1 parent d641b47 commit 9db036e

File tree

4 files changed

+156
-0
lines changed

4 files changed

+156
-0
lines changed

API.md

Lines changed: 52 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export interface ApplicationSource {
99
readonly path?: string;
1010
readonly directory?: ApplicationDirectory;
1111
readonly plugin?: ApplicationPlugin;
12+
readonly helm?: HelmOptions;
1213

1314
}
1415

@@ -58,6 +59,37 @@ export interface ArgoCdApplicationSpec {
5859
readonly ignoreDifferences?: ResourceIgnoreDifferences[];
5960
}
6061

62+
export interface HelmOptions {
63+
readonly valueFiles?: string[];
64+
readonly values?: { [key: string]: string };
65+
readonly releaseName?: string;
66+
readonly chart?: string;
67+
readonly version?: string;
68+
readonly repo?: string;
69+
readonly targetRevision?: string;
70+
readonly helmVersion?: string;
71+
readonly helmOptions?: string[];
72+
readonly verify?: boolean;
73+
readonly wait?: boolean;
74+
readonly timeout?: string;
75+
readonly force?: boolean;
76+
readonly install?: boolean;
77+
readonly upgrade?: boolean;
78+
readonly lint?: boolean;
79+
readonly valuesFrom?: HelmValuesFromSource[];
80+
}
81+
82+
export interface HelmValuesFromSource {
83+
readonly kind?: string;
84+
readonly name?: string;
85+
readonly namespace?: string;
86+
readonly group?: string;
87+
readonly version?: string;
88+
readonly jsonPointers?: string[];
89+
readonly jqPathExpressions?: string[];
90+
readonly values?: { [key: string]: string };
91+
}
92+
6193
export interface ResourceIgnoreDifferences {
6294
readonly jsonPointers?: string[];
6395
readonly jqPathExpressions?: string[];

test/__snapshots__/hello.test.ts.snap

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/hello.test.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,39 @@ test('app', () => {
3333

3434
expect(Testing.synth(chart)).toMatchSnapshot();
3535
});
36+
37+
test('app with helm', () => {
38+
const app = Testing.app();
39+
const chart = new Chart(app, 'test', {
40+
namespace: 'test',
41+
});
42+
43+
new argo.ArgoCdApplication(chart, 'test', {
44+
spec: {
45+
project: 'test',
46+
ignoreDifferences: [
47+
{
48+
kind: 'Deployment',
49+
jsonPointers: [
50+
'/spec/replicas',
51+
],
52+
group: 'apps',
53+
},
54+
55+
],
56+
source: {
57+
repoURL: 'test',
58+
targetRevision: 'test',
59+
path: 'test',
60+
helm: {
61+
valueFiles: [
62+
'test',
63+
],
64+
version: 'v3',
65+
},
66+
},
67+
},
68+
});
69+
70+
expect(Testing.synth(chart)).toMatchSnapshot();
71+
});

0 commit comments

Comments
 (0)