Skip to content

Commit 29a8687

Browse files
authored
Merge pull request #98 from aali309/7265-showArgocdAppsets
Show Argo CD ApplicationSets in list page in Dev Console
2 parents 5ac8af3 + 2808794 commit 29a8687

File tree

11 files changed

+705
-4
lines changed

11 files changed

+705
-4
lines changed

console-extensions.json

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,24 @@
247247
"required": ["APPLICATION"]
248248
}
249249
},
250+
{
251+
"type": "console.model-metadata",
252+
"properties": {
253+
"model": {
254+
"group": "argoproj.io",
255+
"version": "v1alpha1",
256+
"kind": "ApplicationSet"
257+
},
258+
"badge": "dev",
259+
"color": "#E9654B",
260+
"label": "Argo CD ApplicationSet",
261+
"labelPlural": "Argo CD ApplicationSets",
262+
"abbr": "AS"
263+
},
264+
"flags": {
265+
"required": ["APPLICATIONSET"]
266+
}
267+
},
250268
{
251269
"type": "console.flag/model",
252270
"properties": {
@@ -258,6 +276,17 @@
258276
}
259277
}
260278
},
279+
{
280+
"type": "console.flag/model",
281+
"properties": {
282+
"flag": "APPLICATIONSET",
283+
"model": {
284+
"group": "argoproj.io",
285+
"kind": "ApplicationSet",
286+
"version": "v1alpha1"
287+
}
288+
}
289+
},
261290
{
262291
"type": "console.navigation/resource-ns",
263292
"properties": {
@@ -272,6 +301,20 @@
272301
}
273302
}
274303
},
304+
{
305+
"type": "console.navigation/resource-ns",
306+
"properties": {
307+
"id": "applicationset",
308+
"name": "ApplicationSets",
309+
"perspective": "admin",
310+
"section": "gitops-navigation-section",
311+
"model": {
312+
"group": "argoproj.io",
313+
"kind": "ApplicationSet",
314+
"version": "v1alpha1"
315+
}
316+
}
317+
},
275318
{
276319
"type": "console.page/resource/list",
277320
"flags": {
@@ -290,6 +333,24 @@
290333
}
291334
}
292335
},
336+
{
337+
"type": "console.page/resource/list",
338+
"flags": {
339+
"required": [
340+
"APPLICATIONSET"
341+
]
342+
},
343+
"properties": {
344+
"model": {
345+
"group": "argoproj.io",
346+
"kind": "ApplicationSet",
347+
"version": "v1alpha1"
348+
},
349+
"component": {
350+
"$codeRef": "ApplicationSetList"
351+
}
352+
}
353+
},
293354
{
294355
"type": "console.yaml-template",
295356
"flags": {
@@ -308,5 +369,24 @@
308369
"$codeRef": "yamlApplicationTemplates.defaultApplicationYamlTemplate"
309370
}
310371
}
372+
},
373+
{
374+
"type": "console.yaml-template",
375+
"flags": {
376+
"required": [
377+
"APPLICATIONSET"
378+
]
379+
},
380+
"properties": {
381+
"name": "default",
382+
"model": {
383+
"group": "argoproj.io",
384+
"kind": "ApplicationSet",
385+
"version": "v1alpha1"
386+
},
387+
"template": {
388+
"$codeRef": "yamlApplicationTemplates.defaultApplicationSetYamlTemplate"
389+
}
390+
}
311391
}
312392
]

locales/en/plugin__gitops-plugin.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,13 @@
6363
"Edit Application": "Edit Application",
6464
"Delete Application": "Delete Application",
6565
"Actions": "Actions",
66-
"You don't have permission to perform this action": "You don't have permission to perform this action"
66+
"You don't have permission to perform this action": "You don't have permission to perform this action",
67+
"ApplicationSets": "Argo CD ApplicationSets",
68+
"Create ApplicationSet": "Create ApplicationSet",
69+
"No ApplicationSets found": "No ApplicationSets found",
70+
"Edit ApplicationSet": "Edit ApplicationSet",
71+
"Delete ApplicationSet": "Delete ApplicationSet",
72+
"Generators": "Generators",
73+
"Healthy": "Healthy",
74+
"Error": "Error"
6775
}

locales/ja/plugin__gitops-plugin.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,13 @@
6363
"Edit Application": "Edit Application",
6464
"Delete Application": "Delete Application",
6565
"Actions": "Actions",
66-
"You don't have permission to perform this action": "You don't have permission to perform this action"
66+
"You don't have permission to perform this action": "You don't have permission to perform this action",
67+
"ApplicationSets": "ApplicationSets",
68+
"Create ApplicationSet": "Create ApplicationSet",
69+
"No ApplicationSets found": "No ApplicationSets found",
70+
"Edit ApplicationSet": "Edit ApplicationSet",
71+
"Delete ApplicationSet": "Delete ApplicationSet",
72+
"Generators": "Generators",
73+
"Healthy": "Healthy",
74+
"Error": "Error"
6775
}

locales/ko/plugin__gitops-plugin.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,13 @@
6363
"Edit Application": "Edit Application",
6464
"Delete Application": "Delete Application",
6565
"Actions": "Actions",
66-
"You don't have permission to perform this action": "You don't have permission to perform this action"
66+
"You don't have permission to perform this action": "You don't have permission to perform this action",
67+
"ApplicationSets": "ApplicationSets",
68+
"Create ApplicationSet": "Create ApplicationSet",
69+
"No ApplicationSets found": "No ApplicationSets found",
70+
"Edit ApplicationSet": "Edit ApplicationSet",
71+
"Delete ApplicationSet": "Delete ApplicationSet",
72+
"Generators": "Generators",
73+
"Healthy": "Healthy",
74+
"Error": "Error"
6775
}

locales/zh/plugin__gitops-plugin.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,13 @@
6363
"Edit Application": "Edit Application",
6464
"Delete Application": "Delete Application",
6565
"Actions": "Actions",
66-
"You don't have permission to perform this action": "You don't have permission to perform this action"
66+
"You don't have permission to perform this action": "You don't have permission to perform this action",
67+
"ApplicationSets": "ApplicationSets",
68+
"Create ApplicationSet": "Create ApplicationSet",
69+
"No ApplicationSets found": "No ApplicationSets found",
70+
"Edit ApplicationSet": "Edit ApplicationSet",
71+
"Delete ApplicationSet": "Delete ApplicationSet",
72+
"Generators": "Generators",
73+
"Healthy": "Healthy",
74+
"Error": "Error"
6775
}

plugin-metadata.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const metadata: ConsolePluginBuildMetadata = {
1414
"gitopsFlags": "./components/utils/flags",
1515
"topology": "./components/topology",
1616
ApplicationList: "./gitops/components/application/ApplicationListTab.tsx",
17+
ApplicationSetList: "./gitops/components/application/ApplicationSetListTab.tsx",
1718
yamlApplicationTemplates: "./gitops/components/application/templates/index.ts"
1819
}
1920
};
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import * as React from 'react';
2+
3+
import ApplicationSetList from '../shared/ApplicationSetList';
4+
5+
type ApplicationSetListProps = {
6+
namespace: string;
7+
hideNameLabelFilters?: boolean;
8+
showTitle?: boolean;
9+
};
10+
11+
const ApplicationSetListTab: React.FC<ApplicationSetListProps> = ({
12+
namespace,
13+
hideNameLabelFilters,
14+
showTitle,
15+
}) => {
16+
return (
17+
<ApplicationSetList
18+
namespace={namespace}
19+
hideNameLabelFilters={hideNameLabelFilters}
20+
showTitle={showTitle}
21+
/>
22+
);
23+
};
24+
25+
export default ApplicationSetListTab;
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
export const defaultApplicationSetYamlTemplate = `
2+
apiVersion: "argoproj.io/v1alpha1"
3+
kind: "ApplicationSet"
4+
metadata:
5+
name: "myappset"
6+
spec:
7+
generators:
8+
- list:
9+
elements:
10+
- name: "myapp"
11+
cluster: "in-cluster"
12+
url: "https://kubernetes.default.svc"
13+
template:
14+
metadata:
15+
name: "{{name}}-{{cluster}}"
16+
spec:
17+
project: default
18+
source:
19+
repoURL: "https://"
20+
targetRevision: HEAD
21+
path: "."
22+
destination:
23+
server: "{{url}}"
24+
namespace: "{{name}}"
25+
syncPolicy:
26+
automated:
27+
prune: true
28+
selfHeal: true
29+
`;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export * from './application-yaml';
2+
export * from './applicationset-yaml';

0 commit comments

Comments
 (0)