-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1504 from cloud-pi-native/feat/kubeconfig-in-vault-2
feat: ✨ store cluster secret in Vault
- Loading branch information
Showing
11 changed files
with
131 additions
and
38 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
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
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
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,29 @@ | ||
import { type StepCall, type ZoneObject, parseError } from '@cpn-console/hooks' | ||
import { dump } from 'js-yaml' | ||
|
||
export const upsertZone: StepCall<ZoneObject> = async (payload) => { | ||
try { | ||
const zone = payload.args | ||
const { gitlab, vault } = payload.apis | ||
const values = { | ||
vault: await vault.getCredentials(), | ||
clusters: zone.clusterNames, | ||
} | ||
const zoneRepo = await gitlab.getOrCreateInfraProject(zone.slug) | ||
await gitlab.commitCreateOrUpdate(zoneRepo.id, dump(values), 'argocd-values.yaml') | ||
return { | ||
status: { | ||
result: 'OK', | ||
message: 'Zone argocd configuration created/updated', | ||
}, | ||
} | ||
} catch (error) { | ||
return { | ||
error: parseError(error), | ||
status: { | ||
result: 'KO', | ||
message: 'Failed create/update zone argocd configuration', | ||
}, | ||
} | ||
} | ||
} |
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
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