Skip to content

Commit 455ec63

Browse files
olegz-codefresh123
andauthored
CR-620 rename patch gitops to upgrade gitops (#569)
Co-authored-by: 123 <git config --global user.name 123a.aladov@codefresh.io>
1 parent c57afd0 commit 455ec63

File tree

2 files changed

+43
-5
lines changed

2 files changed

+43
-5
lines changed

lib/interface/cli/commands/gitops/patch.cmd.js renamed to lib/interface/cli/commands/gitops/upgrade.cmd.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
const Command = require('../../Command');
22

3-
const applyRoot = require('../root/apply.cmd');
3+
const upgradeRoot = require('../root/upgrade.cmd');
44
const { downloadArgo } = require('../hybrid/helper');
55
const { Runner, components } = require('../../../../binary');
66

77
const command = new Command({
88
root: false,
9-
parent: applyRoot,
9+
parent: upgradeRoot,
1010
command: 'gitops',
11-
description: 'Patch gitops agent',
11+
description: 'Upgrade gitops agent',
1212
webDocs: {
1313
category: 'Gitops',
14-
title: 'Patch',
14+
title: 'Upgrade',
1515
weight: 100,
1616
},
1717
builder: (yargs) => {
@@ -20,7 +20,7 @@ const command = new Command({
2020
describe: 'Path to kubeconfig file (default is $HOME/.kube/config)',
2121
})
2222
.example(
23-
'codefresh patch gitops',
23+
'codefresh upgrade gitops',
2424
'Update gitops agent',
2525
);
2626
},
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
const CFError = require('cf-errors');
2+
const Command = require('../../Command');
3+
const { crudFilenameOption } = require('../../helpers/general');
4+
const yargs = require('yargs');
5+
6+
7+
const upgrade = new Command({
8+
root: true,
9+
command: 'upgrade',
10+
description: 'Upgrade a resource by filename or stdin',
11+
usage: 'Upgrade operation will apply only passed changes to an existing resource and will throw an error if the resource does not exist.\n\n Supported resources: \n\t\'Context\'',
12+
webDocs: {
13+
description: 'Upgrade a resource from a file, directory or url',
14+
category: 'Operate On Resources',
15+
title: 'Upgrade',
16+
weight: 40,
17+
},
18+
builder: (yargs) => {
19+
crudFilenameOption(yargs);
20+
return yargs;
21+
},
22+
handler: async (argv) => {
23+
if (!argv.filename) {
24+
yargs.showHelp();
25+
}
26+
27+
const data = argv.filename;
28+
const entity = data.kind;
29+
30+
switch (entity) {
31+
default:
32+
throw new CFError(`Entity: ${entity} not supported`);
33+
}
34+
35+
},
36+
});
37+
38+
module.exports = upgrade;

0 commit comments

Comments
 (0)