-
Hello, team! We have a situation, when our operator can have an optional dependent (second) custom resources based on CRD's which are not present when controller start. For example it can be some of the I know, that this case can be handled by validation for CRD is present or not with
Another option, we can create Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 23 replies
-
Hi @dmvolod, how would you envision this working? Do you declare your dependents declaratively (i.e. using annotations)? Which version of the SDK / Quarkus extension are you using? |
Beta Was this translation helpful? Give feedback.
-
Hi @metacosm Thanks for response. Tried both options: declare as var pipelinesInformerConfig = InformerConfiguration.from(ServiceMonitor.class, context)
.withLabelSelector(Constants.K8S_OPERATOR_MANAGED_BY_SELECTOR)
.build();
return EventSourceInitializer.nameEventSources(new InformerEventSource<>(pipelinesInformerConfig, context)); Using Quarkiverse operator SDK 5.1.1 |
Beta Was this translation helpful? Give feedback.
-
Yes, tried 2023-03-06 21:19:00,035 WARN [io.fab.kub.cli.inf.imp.cac.Reflector] (OkHttp Dispatcher) listSyncAndWatch failed for monitoring.coreos.com/v1/servicemonitors, will retry: java.util.concurrent.CompletionException: io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: GET at: https://127.0.0.1:44809/apis/monitoring.coreos.com/v1/servicemonitors. Message: Not Found.
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:649)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2147)
at io.fabric8.kubernetes.client.dsl.internal.OperationSupport.lambda$retryWithExponentialBackoff$2(OperationSupport.java:643)
at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863)
at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:841)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2147)
at io.fabric8.kubernetes.client.http.ByteArrayBodyHandler.onBodyDone(ByteArrayBodyHandler.java:52)
at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863)
at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:841)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2147)
at io.fabric8.kubernetes.client.okhttp.OkHttpClientImpl$OkHttpAsyncBody.doConsume(OkHttpClientImpl.java:133)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833) Another option, it's possible to create informer manually and than, have to invoke a |
Beta Was this translation helpful? Give feedback.
Yes, tried
reconcilePrecondition
without success in our case.But seems to find a solution, with
stopOnInformerErrorDuringStartup
disabled. Otherwise would be nice to have an option to validate CRD available viaclient.getApiResources
and than run informer in dynamic.In this case, following error should be suppressed