diff options
author | Valerij Fredriksen <valerijf@oath.com> | 2018-09-28 12:56:55 +0200 |
---|---|---|
committer | Valerij Fredriksen <valerijf@oath.com> | 2018-09-28 12:56:55 +0200 |
commit | 5563eacaea33de65a508e6f57b39170d21ec2259 (patch) | |
tree | 3829a5bfa14caf77e2677bcb74b28cc2119b4fb6 /node-admin | |
parent | 157c8b77cfe432d0476f91eb87780e6b1fcd499f (diff) |
Only start services if stopped
Diffstat (limited to 'node-admin')
2 files changed, 3 insertions, 3 deletions
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImpl.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImpl.java index 36a2672b1a6..b2f04a3346c 100644 --- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImpl.java +++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImpl.java @@ -89,7 +89,7 @@ public class NodeAgentImpl implements NodeAgent { private Optional<Future<?>> currentFilebeatRestarter = Optional.empty(); private boolean hasResumedNode = false; - private boolean hasStartedServices = false; + private boolean hasStartedServices = true; /** * ABSENT means container is definitely absent - A container that was absent will not suddenly appear without diff --git a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImplTest.java b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImplTest.java index 635b50246f4..62f69aa12cf 100644 --- a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImplTest.java +++ b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImplTest.java @@ -131,7 +131,7 @@ public class NodeAgentImplTest { final InOrder inOrder = inOrder(dockerOperations, orchestrator, nodeRepository); // TODO: Verify this isn't run unless 1st time - inOrder.verify(dockerOperations, times(1)).startServices(eq(containerName)); + inOrder.verify(dockerOperations, never()).startServices(eq(containerName)); inOrder.verify(dockerOperations, times(1)).resumeNode(eq(containerName)); inOrder.verify(orchestrator).resume(hostName); } @@ -176,7 +176,7 @@ public class NodeAgentImplTest { when(storageMaintainer.getDiskUsageFor(eq(containerName))).thenReturn(Optional.of(187500000000L)); nodeAgent.converge(); - inOrder.verify(dockerOperations, times(1)).startServices(eq(containerName)); + inOrder.verify(dockerOperations, never()).startServices(eq(containerName)); inOrder.verify(dockerOperations, times(1)).resumeNode(eq(containerName)); nodeAgent.suspend(); |