diff --git a/.idea/misc.xml b/.idea/misc.xml index c3e2bc45..1946455c 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -11,5 +11,5 @@ - + \ No newline at end of file diff --git a/gradle/detekt-config.yml b/gradle/detekt-config.yml index a702747d..d8587264 100644 --- a/gradle/detekt-config.yml +++ b/gradle/detekt-config.yml @@ -14,3 +14,9 @@ style: ignoreOverridden: true ReturnCount: active: false + ForbiddenComment: + active: false + +potential-bugs: + UnsafeCallOnNullableType: + active: false diff --git a/packages/shulker-proxy-agent/src/common/kotlin/io/shulkermc/proxyagent/adapters/kubernetes/ImplKubernetesGatewayAdapter.kt b/packages/shulker-proxy-agent/src/common/kotlin/io/shulkermc/proxyagent/adapters/kubernetes/ImplKubernetesGatewayAdapter.kt index b56ba0d4..569902fc 100644 --- a/packages/shulker-proxy-agent/src/common/kotlin/io/shulkermc/proxyagent/adapters/kubernetes/ImplKubernetesGatewayAdapter.kt +++ b/packages/shulker-proxy-agent/src/common/kotlin/io/shulkermc/proxyagent/adapters/kubernetes/ImplKubernetesGatewayAdapter.kt @@ -59,7 +59,7 @@ class ImplKubernetesGatewayAdapter(proxyNamespace: String, proxyName: String) : .withName(Configuration.PROXY_FLEET_NAME) .get() - if (service.spec.type !== "LoadBalancer") { + if (service.spec.type != "LoadBalancer") { return Optional.empty() } diff --git a/packages/shulker-proxy-agent/src/common/kotlin/io/shulkermc/proxyagent/services/ProxyLifecycleService.kt b/packages/shulker-proxy-agent/src/common/kotlin/io/shulkermc/proxyagent/services/ProxyLifecycleService.kt index e0c8de12..319a0232 100644 --- a/packages/shulker-proxy-agent/src/common/kotlin/io/shulkermc/proxyagent/services/ProxyLifecycleService.kt +++ b/packages/shulker-proxy-agent/src/common/kotlin/io/shulkermc/proxyagent/services/ProxyLifecycleService.kt @@ -14,7 +14,7 @@ class ProxyLifecycleService(private val agent: ShulkerProxyAgentCommon) { } private val ttlTask: ProxyInterface.ScheduledTask - private var drainingFuture: CompletableFuture? = null + private var drainingFuture: CompletableFuture? = null init { this.agent.kubernetesGateway.watchProxyEvents { action, proxy -> @@ -40,15 +40,15 @@ class ProxyLifecycleService(private val agent: ShulkerProxyAgentCommon) { this.ttlTask.cancel() } - fun drain(): CompletableFuture { + fun drain(): CompletableFuture { if (this.drainingFuture != null) { return this.drainingFuture!! } - this.drainingFuture = CompletableFuture() + this.drainingFuture = CompletableFuture() this.agent.fileSystem.createDrainLock() - // FIXME: Rather than hardcoding a task, wait for Kubernetes to + // TODO: Rather than hardcoding a task, wait for Kubernetes to // exclude the proxy from the Service. this.agent.proxyInterface.scheduleDelayedTask( @Suppress("MagicNumber") 30L, @@ -59,7 +59,7 @@ class ProxyLifecycleService(private val agent: ShulkerProxyAgentCommon) { this.agent.logger.info("Proxy is now draining") - return this.drainingFuture!!.thenAccept { + return this.drainingFuture!!.thenApply { this.onExcludedFromKubernetes() } }