diff --git a/cos-fleetshard-sync/src/main/java/org/bf2/cos/fleetshard/sync/client/FleetShardClient.java b/cos-fleetshard-sync/src/main/java/org/bf2/cos/fleetshard/sync/client/FleetShardClient.java index 40c66f9d..883beece 100644 --- a/cos-fleetshard-sync/src/main/java/org/bf2/cos/fleetshard/sync/client/FleetShardClient.java +++ b/cos-fleetshard-sync/src/main/java/org/bf2/cos/fleetshard/sync/client/FleetShardClient.java @@ -238,7 +238,6 @@ public Optional getSecret(String namespaceId, String deploymentId) { .get()); } - public Optional getProcessorSecret(String namespaceId, String deploymentId) { return Optional.ofNullable( kubernetesClient.secrets() @@ -325,7 +324,6 @@ public List getAllConnectors() { return connectorsInformer.getIndexer().list(); } - public List getAllProcessors() { if (processorsInformer == null) { throw new IllegalStateException("Informer must be started before adding handlers"); diff --git a/cos-fleetshard-sync/src/main/java/org/bf2/cos/fleetshard/sync/resources/ProcessorStatusUpdater.java b/cos-fleetshard-sync/src/main/java/org/bf2/cos/fleetshard/sync/resources/ProcessorStatusUpdater.java index a2756f91..bd843d82 100644 --- a/cos-fleetshard-sync/src/main/java/org/bf2/cos/fleetshard/sync/resources/ProcessorStatusUpdater.java +++ b/cos-fleetshard-sync/src/main/java/org/bf2/cos/fleetshard/sync/resources/ProcessorStatusUpdater.java @@ -48,44 +48,44 @@ public void update(ManagedProcessor processor) { processor.getMetadata().getName(), processor.getStatus().getPhase()); -// try { -// ProcessorDeploymentStatus ProcessorDeploymentStatus = Process.extract(processor); - -// fleetManagerClient.updateConnectorStatus(processor, ProcessorDeploymentStatus); - -// LOGGER.debug("Updating Connector status metrics (Connector_id: {}, state: {})", -// processor.get(), ProcessorDeploymentStatus.getPhase()); -// -// switch (ProcessorDeploymentStatus.getPhase()) { -// case READY: -// measure(processor, ProcessorDeploymentStatus, CONNECTOR_STATE_READY); -// break; -// case FAILED: -// measure(processor, ProcessorDeploymentStatus, CONNECTOR_STATE_FAILED); -// break; -// case DELETED: -// measure(processor, ProcessorDeploymentStatus, CONNECTOR_STATE_DELETED); -// break; -// case STOPPED: -// measure(processor, ProcessorDeploymentStatus, CONNECTOR_STATE_STOPPED); -// break; -// default: -// measure(processor, ProcessorDeploymentStatus, CONNECTOR_STATE_IN_PROCESS); -// break; -// } - -// } catch (FleetManagerClientException e) { -// if (e.getStatusCode() == 410) { -// LOGGER.info("Connector " + processor.getMetadata().getName() + " does not exists anymore, deleting it"); -// if (connectorClient.deleteConnector(processor)) { -// LOGGER.info("Connector " + processor.getMetadata().getName() + " deleted"); -// } -// } else { -// LOGGER.warn("Error updating status of connector " + processor.getMetadata().getName(), e); -// } -// } catch (Exception e) { -// LOGGER.warn("Error updating status of connector " + processor.getMetadata().getName(), e); -// } + // try { + // ProcessorDeploymentStatus ProcessorDeploymentStatus = Process.extract(processor); + + // fleetManagerClient.updateConnectorStatus(processor, ProcessorDeploymentStatus); + + // LOGGER.debug("Updating Connector status metrics (Connector_id: {}, state: {})", + // processor.get(), ProcessorDeploymentStatus.getPhase()); + // + // switch (ProcessorDeploymentStatus.getPhase()) { + // case READY: + // measure(processor, ProcessorDeploymentStatus, CONNECTOR_STATE_READY); + // break; + // case FAILED: + // measure(processor, ProcessorDeploymentStatus, CONNECTOR_STATE_FAILED); + // break; + // case DELETED: + // measure(processor, ProcessorDeploymentStatus, CONNECTOR_STATE_DELETED); + // break; + // case STOPPED: + // measure(processor, ProcessorDeploymentStatus, CONNECTOR_STATE_STOPPED); + // break; + // default: + // measure(processor, ProcessorDeploymentStatus, CONNECTOR_STATE_IN_PROCESS); + // break; + // } + + // } catch (FleetManagerClientException e) { + // if (e.getStatusCode() == 410) { + // LOGGER.info("Connector " + processor.getMetadata().getName() + " does not exists anymore, deleting it"); + // if (connectorClient.deleteConnector(processor)) { + // LOGGER.info("Connector " + processor.getMetadata().getName() + " deleted"); + // } + // } else { + // LOGGER.warn("Error updating status of connector " + processor.getMetadata().getName(), e); + // } + // } catch (Exception e) { + // LOGGER.warn("Error updating status of connector " + processor.getMetadata().getName(), e); + // } } /* @@ -102,7 +102,7 @@ private void measure(ManagedProcessor processor, ProcessorDeploymentStatus Proce tags.add(Tag.of("cos.deployment.id", processor.getSpec().getDeploymentId())); tags.add(Tag.of("cos.namespace", processor.getMetadata().getNamespace())); -// String connectorResourceVersion = String.valueOf(processor.getSpec().getDeployment().getConnectorResourceVersion()); + // String connectorResourceVersion = String.valueOf(processor.getSpec().getDeployment().getConnectorResourceVersion()); Gauge gauge = registry.find(config.metrics().baseName() + "." + CONNECTOR_STATE).tags(tags).gauge(); @@ -123,7 +123,7 @@ private void measure(ManagedProcessor processor, ProcessorDeploymentStatus Proce Counter.builder(config.metrics().baseName() + "." + CONNECTOR_STATE_COUNT) .tags(tags) .tag("cos.connector.state", ProcessorDeploymentStatus.getPhase().getValue()) -// .tag("cos.connector.resourceversion", connectorResourceVersion) + // .tag("cos.connector.resourceversion", connectorResourceVersion) .register(registry) .increment(); @@ -138,7 +138,7 @@ private void measure(ManagedProcessor processor, ProcessorDeploymentStatus Proce Counter.builder(config.metrics().baseName() + "." + CONNECTOR_STATE_COUNT) .tags(tags) .tag("cos.connector.state", "failed_but_ready") -// .tag("cos.connector.resourceversion", connectorResourceVersion) + // .tag("cos.connector.resourceversion", connectorResourceVersion) .register(registry) .increment(); }