diff options
author | Harald Musum <musum@yahoo-inc.com> | 2016-12-08 14:09:04 +0100 |
---|---|---|
committer | Harald Musum <musum@yahoo-inc.com> | 2016-12-08 14:09:04 +0100 |
commit | 7cb3bcb3269ee87baa9b08b9ce62ffffab65ed87 (patch) | |
tree | 3efcdf7491eb5f4a6949c4f51130bf36a801b60f /node-admin | |
parent | 7f2ad2c13962eaa8fd6752f6b3b445fb310fe3af (diff) |
Do not set current restart generation unless in spec
* Node repo only allows updateing current restart generation for
allocated nodes, set to null (so that it will not be a part of request)
unless wanted restart generation exists
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 d72b52f4e61..a0c25581b7e 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 @@ -199,7 +199,7 @@ public class NodeAgentImpl implements NodeAgent { nodeSpec.hostname, // Clear current Docker image and vespa version, as nothing is running on this node new NodeAttributes() - .withRestartGeneration(nodeSpec.wantedRestartGeneration.orElse(0L)) + .withRestartGeneration(nodeSpec.wantedRestartGeneration.orElse(null)) .withRebootGeneration(nodeSpec.wantedRebootGeneration.orElse(0L)) .withDockerImage(new DockerImage("")) .withVespaVersion("")); @@ -208,7 +208,7 @@ public class NodeAgentImpl implements NodeAgent { private void updateNodeRepoWithCurrentAttributes(final ContainerNodeSpec nodeSpec) throws IOException { final NodeAttributes nodeAttributes = new NodeAttributes() - .withRestartGeneration(nodeSpec.wantedRestartGeneration.orElse(0L)) + .withRestartGeneration(nodeSpec.wantedRestartGeneration.orElse(null)) // update reboot gen with wanted gen if set, we ignore reboot for Docker nodes but // want the two to be equal in node repo .withRebootGeneration(nodeSpec.wantedRebootGeneration.orElse(0L)) 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 1aed35615db..084f58fc7b6 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 @@ -389,7 +389,7 @@ public class NodeAgentImplTest { // current Docker image and vespa version should be cleared verify(nodeRepository, times(1)).updateNodeAttributes( any(String.class), eq(new NodeAttributes() - .withRestartGeneration(wantedRestartGeneration.orElse(0L)) + .withRestartGeneration(wantedRestartGeneration.orElse(null)) .withRebootGeneration(0L) .withDockerImage(new DockerImage("")) .withVespaVersion(""))); |