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

Commit 182e224

Browse files
committed
fix: verify CRD is available on startup
Signed-off-by: Markus Maga <[email protected]>
1 parent b7358b1 commit 182e224

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

bin/daemon.js

+10
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@ async function main () {
3737

3838
kubeClient.addCustomResourceDefinition(customResourceManifest)
3939

40+
try {
41+
logger.info('verifiying CRD is installed')
42+
await kubeClient
43+
.apis[customResourceManifest.spec.group]
44+
.v1[customResourceManifest.spec.names.plural].get()
45+
} catch (err) {
46+
logger.error('CRD installation check failed, statusCode: %s', err.statusCode)
47+
process.exit(1)
48+
}
49+
4050
const externalSecretEvents = getExternalSecretEvents({
4151
kubeClient,
4252
watchedNamespaces,

0 commit comments

Comments
 (0)