Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

Commit

Permalink
fix: verify CRD is available on startup
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Maga <[email protected]>
  • Loading branch information
Flydiverny committed Jun 3, 2021
1 parent b7358b1 commit 182e224
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions bin/daemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ async function main () {

kubeClient.addCustomResourceDefinition(customResourceManifest)

try {
logger.info('verifiying CRD is installed')
await kubeClient
.apis[customResourceManifest.spec.group]
.v1[customResourceManifest.spec.names.plural].get()
} catch (err) {
logger.error('CRD installation check failed, statusCode: %s', err.statusCode)
process.exit(1)
}

const externalSecretEvents = getExternalSecretEvents({
kubeClient,
watchedNamespaces,
Expand Down

0 comments on commit 182e224

Please sign in to comment.