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 @@ -133,7 +133,7 @@ public static void handleKubernetesClientException(Exception e, String resourceT
// only throw MissingCRDException if the 404 error occurs on the target CRD
if (resourceTypeName.equals(ke.getFullResourceName())
|| matchesResourceType(resourceTypeName, ke)) {
throw new MissingCRDException(resourceTypeName, null, e.getMessage(), e);
throw new MissingCRDException(resourceTypeName, ke.getVersion(), e.getMessage(), e);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ public synchronized void start(boolean startEventProcessor) throws OperatorExcep
log.info("'{}' controller started, pending event sources initialization", controllerName);
} catch (MissingCRDException e) {
stop();
throwMissingCRDException(crdName, specVersion, controllerName);
throwMissingCRDException(e.getCrdName(), e.getSpecVersion(), controllerName);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
import java.util.function.Predicate;
import java.util.stream.Stream;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import io.fabric8.kubernetes.api.model.HasMetadata;
import io.fabric8.kubernetes.client.informers.ResourceEventHandler;
import io.fabric8.kubernetes.client.informers.SharedIndexInformer;
Expand All @@ -20,6 +23,8 @@
class InformerWrapper<T extends HasMetadata>
implements LifecycleAware, IndexerResourceCache<T> {

private static final Logger log = LoggerFactory.getLogger(InformerWrapper.class);

private final SharedIndexInformer<T> informer;
private final Cache<T> cache;

Expand All @@ -33,8 +38,12 @@ public void start() throws OperatorException {
try {
informer.run();
} catch (Exception e) {
ReconcilerUtils.handleKubernetesClientException(e,
HasMetadata.getFullResourceName(informer.getApiTypeClass()));
final var apiTypeClass = informer.getApiTypeClass();
final var fullResourceName = HasMetadata.getFullResourceName(apiTypeClass);
final var version = HasMetadata.getVersion(apiTypeClass);
log.error("Couldn't start informer for " + fullResourceName + "/" + version + " resources",
e);
ReconcilerUtils.handleKubernetesClientException(e, fullResourceName);
throw e;
}
}
Expand Down