instana/instana-agent-operator

operator should fail if required configuration not found

Closed this issue · 0 comments

fstab commented

If the required config maps are not found, the operator logs an exception and continues running without failure:

java.lang.IllegalStateException: Operator ConfigMap named config not found in namespace local
        at com.instana.operator.service.InstanaConfigService.onStartup(InstanaConfigService.java:34)
        at com.instana.operator.service.InstanaConfigService_Observer_onStartup_8d7b338c7415a5b0bcaaf3b82fd300311baae948.notify(Unknown Source)
        at io.quarkus.arc.EventImpl$Notifier.notify(EventImpl.java:244)
        at io.quarkus.arc.EventImpl.fire(EventImpl.java:85)
        at io.quarkus.arc.runtime.LifecycleEventRunner.fireStartupEvent(LifecycleEventRunner.java:39)
        at io.quarkus.arc.runtime.ArcDeploymentTemplate.handleLifecycleEvents(ArcDeploymentTemplate.java:115)
        at io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent11.deploy(Unknown Source)
        at io.quarkus.runner.ApplicationImpl1.doStart(Unknown Source)
        at io.quarkus.runtime.Application.start(Application.java:99)
        at io.quarkus.runtime.Application.run(Application.java:206)
        at io.quarkus.runner.GeneratedMain.main(Unknown Source)

Therefore the user will not see in kubectl nor in the Operator Lifecycle Manager UI that the operator has failed.

This happens for example if the user clicks on Create Subscription in the Operator Lifecycle Mangager UI without having created the config maps beforehand.

It would be better to terminate the operator with an error code in that case so that it goes into a crash backoff loop in Kubernetes.