-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
6 changed files
with
90 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const _ = require('lodash'); | ||
const gitopsUninstaller = require('../common/uninstall'); | ||
|
||
class ArgoCDInstall { | ||
// eslint-disable-next-line class-methods-use-this | ||
async uninstall(argv) { | ||
const uninstallOptions = _.pick(argv, ['kube-config-path', 'kube-context-name', 'kube-namespace', 'in-cluster']); | ||
return gitopsUninstaller.uninstall(argv.provider, uninstallOptions); | ||
} | ||
} | ||
module.exports = new ArgoCDInstall(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const _ = require('lodash'); | ||
const gitopsUninstaller = require('../common/uninstall'); | ||
|
||
class CodefreshInstall { | ||
// eslint-disable-next-line class-methods-use-this | ||
async uninstall(argv) { | ||
const uninstallOptions = _.pick(argv, [ | ||
'kube-config-path', 'kube-context-name', 'kube-namespace', 'install-manifest', 'in-cluster', | ||
]); | ||
await gitopsUninstaller.uninstall(argv.provider, uninstallOptions); | ||
} | ||
} | ||
|
||
module.exports = new CodefreshInstall(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
const { downloadProvider } = require('../../hybrid/helper'); | ||
const { Runner, components } = require('../../../../../binary'); | ||
const _ = require('lodash'); | ||
|
||
class GitopsUninstaller { | ||
// eslint-disable-next-line class-methods-use-this | ||
async uninstall(provider, argv) { | ||
const { 'kube-config-path': kubeConfigPath } = argv; | ||
const binLocation = await downloadProvider({ provider }); | ||
const componentRunner = new Runner(binLocation); | ||
|
||
const commands = [ | ||
'uninstall', | ||
]; | ||
|
||
if (kubeConfigPath) { | ||
commands.push('--kubeconfig'); | ||
commands.push(kubeConfigPath); | ||
} | ||
|
||
const installOptions = _.omit(argv, 'kube-config-path'); | ||
|
||
_.forEach(_.pickBy(installOptions, _.identity), (value, key) => { | ||
if (_.isArray(value)) { | ||
value.forEach((item) => { | ||
commands.push(`--${key}`); | ||
commands.push(item); | ||
}); | ||
} else { | ||
commands.push(`--${key}`); | ||
if (value !== true) commands.push(value); | ||
} | ||
}); | ||
|
||
await componentRunner.run(components.gitops[provider], commands); | ||
} | ||
} | ||
|
||
module.exports = new GitopsUninstaller(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters