Skip to content

Commit 3301091

Browse files
ability delete argocd agent (#548)
1 parent 7f8b0d2 commit 3301091

File tree

2 files changed

+54
-1
lines changed

2 files changed

+54
-1
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/* eslint-disable max-len */
2+
const Command = require('../../Command');
3+
const unInstallRoot = require('../root/uninstall.cmd');
4+
const { downloadArgo } = require('../hybrid/helper');
5+
const { Runner, components } = require('../../../../binary');
6+
7+
8+
const unInstallAgentCmd = new Command({
9+
root: false,
10+
parent: unInstallRoot,
11+
command: 'argo',
12+
description: 'Uninstall argo agent',
13+
webDocs: {
14+
category: 'Argo',
15+
title: 'Uninstall',
16+
weight: 100,
17+
},
18+
builder: yargs => yargs
19+
.env('CF_ARG_') // this means that every process.env.CF_ARG_* will be passed to argv
20+
.option('kube-context-name', {
21+
describe: 'Name of the kubernetes context on which monitor should be uninstalled [$CF_ARG_KUBE_CONTEXT_NAME]',
22+
})
23+
.option('kube-namespace', {
24+
describe: 'Name of the namespace on which monitor should be uninstalled [$CF_ARG_KUBE_NAMESPACE]',
25+
}),
26+
handler: async (argv) => {
27+
const {
28+
'kube-namespace': kubeNamespace,
29+
'kube-context-name': kubeContextName,
30+
} = argv;
31+
32+
const binLocation = await downloadArgo();
33+
const componentRunner = new Runner(binLocation);
34+
35+
const commands = [
36+
'uninstall',
37+
];
38+
39+
if (kubeContextName) {
40+
commands.push('--kube-context-name');
41+
commands.push(kubeContextName);
42+
}
43+
44+
if (kubeNamespace) {
45+
commands.push('--kube-namespace');
46+
commands.push(kubeNamespace);
47+
}
48+
49+
await componentRunner.run(components.argo, commands);
50+
},
51+
});
52+
53+
module.exports = unInstallAgentCmd;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codefresh",
3-
"version": "0.71.8",
3+
"version": "0.72.0",
44
"description": "Codefresh command line utility",
55
"main": "index.js",
66
"preferGlobal": true,

0 commit comments

Comments
 (0)