Skip to content

Commit 3ea200e

Browse files
argocd agent update flags (#595)
1 parent a4f20d6 commit 3ea200e

File tree

3 files changed

+35
-4
lines changed

3 files changed

+35
-4
lines changed

lib/binary/components.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@ module.exports = {
5454
branch: 'master',
5555
repo: 'argocd-agent',
5656
},
57-
}
57+
},
5858
},
5959
};

lib/interface/cli/commands/gitops/upgrade.cmd.js

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,31 @@ const command = new Command({
2424
.option('kube-config-path', {
2525
describe: 'Path to kubeconfig file (default is $HOME/.kube/config)',
2626
})
27+
.option('kube-namespace', {
28+
describe: 'Name of the namespace on which Argo agent should be updated',
29+
})
30+
.option('kube-context-name', {
31+
describe: 'Name of the kubernetes context where Argo agent should be updated (default is current-context)',
32+
})
33+
.option('in-cluster', {
34+
type: 'boolean',
35+
default: false,
36+
describe: 'Use this option if Argo agent is been updated from inside a cluster',
37+
})
2738
.example(
28-
'codefresh upgrade gitops',
39+
'codefresh upgrade gitops argocd-agent',
2940
'Update gitops agent',
3041
);
3142
},
3243
handler: async (argv) => {
33-
const { 'kube-config-path': kubeConfigPath, provider } = argv;
44+
const {
45+
provider,
46+
'kube-config-path': kubeConfigPath,
47+
'kube-namespace': kubeNamespace,
48+
'kube-context-name': kubeContextName,
49+
'in-cluster': inCluster,
50+
} = argv;
51+
3452
const binLocation = await downloadProvider({ provider });
3553
const componentRunner = new Runner(binLocation);
3654

@@ -42,9 +60,22 @@ const command = new Command({
4260
commands.push('--kubeconfig');
4361
commands.push(kubeConfigPath);
4462
}
63+
if (kubeNamespace) {
64+
commands.push('--kube-namespace');
65+
commands.push(kubeNamespace);
66+
}
67+
if (kubeContextName) {
68+
commands.push('--kube-context-name');
69+
commands.push(kubeContextName);
70+
}
71+
if (inCluster) {
72+
commands.push('--in-cluster');
73+
commands.push('true');
74+
}
4575

4676
await componentRunner.run(components.gitops[provider], commands);
4777
},
4878
});
4979

5080
module.exports = command;
81+

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

0 commit comments

Comments
 (0)