Skip to content

Commit 621fa87

Browse files
support kubeconfig path (#561)
1 parent 3836d86 commit 621fa87

File tree

4 files changed

+37
-6
lines changed

4 files changed

+37
-6
lines changed

lib/interface/cli/commands/argocd/install.cmd.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,25 @@ const installArgoCmd = new Command({
1515
weight: 100,
1616
},
1717
builder: yargs => yargs
18-
.env('CF_ARG_'),
19-
handler: async () => {
18+
.env('CF_ARG_')
19+
.option('kube-config-path', {
20+
describe: 'Path to kubeconfig file (default is $HOME/.kube/config)',
21+
}),
22+
handler: async (argv) => {
23+
const { 'kube-config-path': kubeConfigPath } = argv;
24+
2025
const binLocation = await downloadArgo();
2126
const componentRunner = new Runner(binLocation);
2227

2328
const commands = [
2429
'install',
2530
];
2631

32+
if (kubeConfigPath) {
33+
commands.push('--kubeconfig');
34+
commands.push(kubeConfigPath);
35+
}
36+
2737
await componentRunner.run(components.argo, commands);
2838
},
2939
});

lib/interface/cli/commands/argocd/patch.cmd.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,29 @@ const command = new Command({
1616
},
1717
builder: (yargs) => {
1818
yargs
19+
.option('kube-config-path', {
20+
describe: 'Path to kubeconfig file (default is $HOME/.kube/config)',
21+
})
1922
.example(
2023
'codefresh patch argocd-agent',
2124
'Update argocd-agent',
2225
);
2326
},
24-
handler: async () => {
27+
handler: async (argv) => {
28+
const { 'kube-config-path': kubeConfigPath } = argv;
29+
2530
const binLocation = await downloadArgo();
2631
const componentRunner = new Runner(binLocation);
2732

2833
const commands = [
2934
'update',
3035
];
3136

37+
if (kubeConfigPath) {
38+
commands.push('--kubeconfig');
39+
commands.push(kubeConfigPath);
40+
}
41+
3242
await componentRunner.run(components.argo, commands);
3343
},
3444
});

lib/interface/cli/commands/argocd/uninstall.cmd.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,24 @@ const unInstallAgentCmd = new Command({
1616
weight: 100,
1717
},
1818
builder: yargs => yargs
19-
.env('CF_ARG_'),
20-
handler: async () => {
19+
.env('CF_ARG_')
20+
.option('kube-config-path', {
21+
describe: 'Path to kubeconfig file (default is $HOME/.kube/config)',
22+
}),
23+
handler: async (argv) => {
24+
const { 'kube-config-path': kubeConfigPath } = argv;
25+
2126
const binLocation = await downloadArgo();
2227
const componentRunner = new Runner(binLocation);
2328
const commands = [
2429
'uninstall',
2530
];
31+
32+
if (kubeConfigPath) {
33+
commands.push('--kubeconfig');
34+
commands.push(kubeConfigPath);
35+
}
36+
2637
await componentRunner.run(components.argo, commands);
2738
},
2839
});

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.72.6",
3+
"version": "0.72.7",
44
"description": "Codefresh command line utility",
55
"main": "index.js",
66
"preferGlobal": true,

0 commit comments

Comments
 (0)