From 7c9969200e80d1db5710c2c7fa2a299aaf42afc0 Mon Sep 17 00:00:00 2001 From: Sergii Kabashniuk Date: Thu, 11 Jul 2019 08:48:25 +0200 Subject: [PATCH] Update the use of Machines in Che (#13808) * Update the use of Machines in Che Signed-off-by: Sergii Kabashniuk --- .../wsplugins/KubernetesBrokerInitContainerApplier.java | 4 +++- .../eclipse/che/api/workspace/server/hc/ServerChecker.java | 4 ++-- .../che/api/workspace/server/hc/ServerCheckerTest.java | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/wsplugins/KubernetesBrokerInitContainerApplier.java b/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/wsplugins/KubernetesBrokerInitContainerApplier.java index ce68f821e94..5f961bb387b 100644 --- a/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/wsplugins/KubernetesBrokerInitContainerApplier.java +++ b/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/wsplugins/KubernetesBrokerInitContainerApplier.java @@ -77,7 +77,9 @@ public void apply( brokerEnvironment.getMachines().get(Names.machineName(brokerPod, container)); if (brokerMachine == null) { throw new InfrastructureException( - String.format("Could not find machine for broker container %s", container.getName())); + String.format( + "Could not retrieve the specification of the plugin broker container %s", + container.getName())); } workspaceEnvironment .getMachines() diff --git a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/hc/ServerChecker.java b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/hc/ServerChecker.java index 83e97f1b732..61170540de6 100644 --- a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/hc/ServerChecker.java +++ b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/hc/ServerChecker.java @@ -77,7 +77,7 @@ public void start() { public void checkOnce(Consumer readinessHandler) throws InfrastructureException { if (!isAvailable()) { throw new InfrastructureException( - String.format("Server '%s' in machine '%s' not available.", serverRef, machineName)); + String.format("Server '%s' in container '%s' not available.", serverRef, machineName)); } readinessHandler.accept(serverRef); } @@ -120,7 +120,7 @@ public void run() { reportFuture.completeExceptionally( new InfrastructureException( String.format( - "Server '%s' in machine '%s' not available.", serverRef, machineName))); + "Server '%s' in container '%s' not available.", serverRef, machineName))); } else if (isAvailable()) { currentNumberOfSequentialSuccessfulPings++; if (currentNumberOfSequentialSuccessfulPings == successThreshold) { diff --git a/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/hc/ServerCheckerTest.java b/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/hc/ServerCheckerTest.java index 4867e15c790..f4a75b9816a 100644 --- a/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/hc/ServerCheckerTest.java +++ b/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/hc/ServerCheckerTest.java @@ -108,7 +108,7 @@ public void checkTimeoutTest() throws Exception { assertTrue(e.getCause() instanceof InfrastructureException); assertEquals( e.getCause().getMessage(), - format("Server '%s' in machine '%s' not available.", SERVER_REF, MACHINE_NAME)); + format("Server '%s' in container '%s' not available.", SERVER_REF, MACHINE_NAME)); } }