-
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.
- Loading branch information
1 parent
1a01afb
commit 89af496
Showing
5 changed files
with
74 additions
and
37 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,9 @@ | ||
const gitopsUpgrader = require('../common/upgrade'); | ||
|
||
class ArgoCDUpgrade { | ||
// eslint-disable-next-line class-methods-use-this | ||
async upgrade(argv) { | ||
return gitopsUpgrader.upgrade(argv); | ||
} | ||
} | ||
module.exports = new ArgoCDUpgrade(); |
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,9 @@ | ||
const gitopsUpgrader = require('../common/upgrade'); | ||
|
||
class CodefreshGitopsUpgrade { | ||
// eslint-disable-next-line class-methods-use-this | ||
async upgrade(argv) { | ||
return gitopsUpgrader.upgrade(argv); | ||
} | ||
} | ||
module.exports = new CodefreshGitopsUpgrade(); |
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,44 @@ | ||
const { downloadProvider } = require('../../hybrid/helper'); | ||
const { Runner, components } = require('../../../../../binary'); | ||
const _ = require('lodash'); | ||
|
||
class GitopsUpgrader { | ||
// eslint-disable-next-line class-methods-use-this | ||
async upgrade(argv) { | ||
const { | ||
provider, | ||
'kube-config-path': kubeConfigPath, | ||
'kube-namespace': kubeNamespace, | ||
'kube-context-name': kubeContextName, | ||
'in-cluster': inCluster, | ||
} = argv; | ||
|
||
const binLocation = await downloadProvider({ provider }); | ||
const componentRunner = new Runner(binLocation); | ||
|
||
const commands = [ | ||
'update', | ||
]; | ||
|
||
if (kubeConfigPath) { | ||
commands.push('--kubeconfig'); | ||
commands.push(kubeConfigPath); | ||
} | ||
if (kubeNamespace) { | ||
commands.push('--kube-namespace'); | ||
commands.push(kubeNamespace); | ||
} | ||
if (kubeContextName) { | ||
commands.push('--kube-context-name'); | ||
commands.push(kubeContextName); | ||
} | ||
if (inCluster) { | ||
commands.push('--in-cluster'); | ||
commands.push('true'); | ||
} | ||
|
||
await componentRunner.run(components.gitops[provider], commands); | ||
} | ||
} | ||
|
||
module.exports = new GitopsUpgrader(); |
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