Skip to content

Commit

Permalink
chore: clean up smells after fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Nuri <marc@marcnuri.com>
(cherry picked from commit b867dd9)
  • Loading branch information
manusa committed Feb 4, 2022
1 parent ce2aa30 commit 31167a1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import io.fabric8.kubernetes.client.utils.Serialization;
import io.fabric8.kubernetes.client.utils.Utils;

import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.util.List;
Expand Down Expand Up @@ -62,15 +61,15 @@ public void onMessage(WebSocket webSocket, ByteBuffer bytes) {
}
} catch (Exception e) {
// can't determine an exit code, just use the whole message as the error
}
}
}
if (exception == null) {
exception = new KubernetesClientException(stringValue);
}
completeFuture.completeExceptionally(exception);
}
}

@Override
public void onClose(WebSocket webSocket, int code, String reason) {
completeFuture.complete(null);
Expand All @@ -92,11 +91,11 @@ final void checkError() {
}
}

final void waitUntilReady(int timeoutMilliseconds) throws IOException, InterruptedException {
final void waitUntilReady(int timeoutMilliseconds) {
Utils.waitUntilReadyOrFail(webSocketRef, timeoutMilliseconds, TimeUnit.MILLISECONDS);
}

final void waitUntilComplete(int timeoutMilliseconds) throws IOException, InterruptedException {
final void waitUntilComplete(int timeoutMilliseconds) throws InterruptedException {
while (webSocketRef.getNow(null).queueSize() > 0 && !completeFuture.isDone()) {
checkError();
Thread.sleep(50);
Expand Down Expand Up @@ -125,7 +124,7 @@ final void waitForQueue(int length) {
Thread.currentThread().interrupt();
}
}

private int parseExitCode(Status status) {
if ("Success".equals(status.getStatus())) {
return 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import org.slf4j.LoggerFactory;

import java.util.Map;
import java.util.Optional;
import java.util.function.Supplier;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import io.fabric8.kubernetes.api.model.APIResource;
import io.fabric8.kubernetes.api.model.APIResourceList;
import io.fabric8.kubernetes.api.model.GroupVersionForDiscovery;
import io.fabric8.kubernetes.api.model.NamespaceBuilder;
import io.fabric8.kubernetes.client.DefaultKubernetesClient;
import io.fabric8.kubernetes.client.KubernetesClient;
import io.fabric8.kubernetes.client.dsl.base.OperationSupport;
Expand Down

0 comments on commit 31167a1

Please sign in to comment.