Skip to content

Commit

Permalink
Catching error
Browse files Browse the repository at this point in the history
  • Loading branch information
psanders committed Aug 1, 2020
1 parent 40da28b commit 37e6c16
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mods/ctl/src/install_secret.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ async function installConfig (context: string) {
const jwtSalt = btoa(fs.readFileSync('/tmp/certs/jwt.salt'))

cli.log(`Removing old 'fonos-config' secret from context '${context}'`)
await k8sApi.deleteNamespacedSecret('fonos-config', context)
try {
await k8sApi.deleteNamespacedSecret('fonos-config', context)
} catch (e) {}

cli.log(`Installing new 'fonos-config' in context '${context}'`)
await k8sApi.createNamespacedSecret(context, {
Expand All @@ -40,7 +42,9 @@ async function installTLSCerts (context: string) {
const cert = btoa(fs.readFileSync('/tmp/certs/server.crt'))

cli.log(`Removing old 'fonos-certs' secret from context '${context}'`)
await k8sApi.deleteNamespacedSecret('fonos-certs', context)
try {
await k8sApi.deleteNamespacedSecret('fonos-certs', context)
} catch (e) {}

cli.log(`Installing new 'fonos-certs' in context '${context}'`)
await k8sApi.createNamespacedSecret(context, {
Expand Down

0 comments on commit 37e6c16

Please sign in to comment.