Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ public interface InformerHealthIndicator extends EventSourceHealthIndicator {
boolean isRunning();

@Override
default Status getStatus() {
return isRunning() && hasSynced() && isWatching() ? Status.HEALTHY : Status.UNHEALTHY;
}
Status getStatus();

String getTargetNamespace();
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import io.javaoperatorsdk.operator.ReconcilerUtils;
import io.javaoperatorsdk.operator.api.config.ConfigurationServiceProvider;
import io.javaoperatorsdk.operator.health.InformerHealthIndicator;
import io.javaoperatorsdk.operator.health.Status;
import io.javaoperatorsdk.operator.processing.LifecycleAware;
import io.javaoperatorsdk.operator.processing.event.ResourceID;
import io.javaoperatorsdk.operator.processing.event.source.IndexerResourceCache;
Expand Down Expand Up @@ -175,6 +176,16 @@ public boolean isRunning() {
return informer.isRunning();
}

@Override
public Status getStatus() {
var status = isRunning() && hasSynced() && isWatching() ? Status.HEALTHY : Status.UNHEALTHY;
log.debug(
"Informer status: {} for for type: {}, namespace: {}, details[ is running: {}, has synced: {}, is watching: {} ]",
status, informer.getApiTypeClass().getSimpleName(), namespaceIdentifier, isRunning(),
hasSynced(), isWatching());
return status;
}

@Override
public String getTargetNamespace() {
return namespaceIdentifier;
Expand Down