diff options
author | Valerij Fredriksen <freva@users.noreply.github.com> | 2020-03-27 13:01:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-27 13:01:02 +0100 |
commit | 49d5cd21637b76e775ecc8e8930ce8129c93806d (patch) | |
tree | 7c50f52c758b16e7298ab6f5e2d0cc97872b1b2d | |
parent | 09ed54fc1141d585af108230d94722d9f5362cac (diff) | |
parent | c3903daaac8bdf318b82f606720d6e688e68a85b (diff) |
Merge pull request #12739 from vespa-engine/hmusum/check-docker-image-in-convergence
Check docker image as well in needsPlatformUpgrade()
3 files changed, 10 insertions, 2 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/NodeWithServices.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/NodeWithServices.java index e3cebfad31c..921bf045873 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/NodeWithServices.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/NodeWithServices.java @@ -53,7 +53,8 @@ public class NodeWithServices { } public boolean needsPlatformUpgrade() { - return node.wantedVersion().isAfter(node.currentVersion()); + return node.wantedVersion().isAfter(node.currentVersion()) + || ! node.wantedDockerImage().equals(node.currentDockerImage()); } public boolean needsReboot() { diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java index 204e0a1c1b8..9e9d27fd744 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java @@ -6,6 +6,7 @@ import com.yahoo.component.AbstractComponent; import com.yahoo.component.Version; import com.yahoo.config.provision.ApplicationId; import com.yahoo.config.provision.ClusterSpec; +import com.yahoo.config.provision.DockerImage; import com.yahoo.config.provision.Environment; import com.yahoo.config.provision.HostName; import com.yahoo.config.provision.NodeResources; @@ -72,6 +73,7 @@ public class ConfigServerMock extends AbstractComponent implements ConfigServer private final Map<DeploymentId, ServiceConvergence> serviceStatus = new HashMap<>(); private final Set<ApplicationId> disallowConvergenceCheckApplications = new HashSet<>(); private final Version initialVersion = new Version(6, 1, 0); + private final DockerImage initialDockerImage = DockerImage.fromString("dockerImage:6.1.0"); private final Set<DeploymentId> suspendedApplications = new HashSet<>(); private final Map<ZoneId, Set<LoadBalancer>> loadBalancers = new HashMap<>(); private final Set<Environment> deferLoadBalancerProvisioning = new HashSet<>(); @@ -105,6 +107,8 @@ public class ConfigServerMock extends AbstractComponent implements ConfigServer .parentHostname(parent.hostname()) .currentVersion(initialVersion) .wantedVersion(initialVersion) + .currentDockerImage(initialDockerImage) + .wantedDockerImage(initialDockerImage) .currentOsVersion(Version.emptyVersion) .wantedOsVersion(Version.emptyVersion) .resources(new NodeResources(2, 8, 50, 1, slow, remote)) diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/NodeRepositoryMock.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/NodeRepositoryMock.java index 632b8499e11..4aab21a44fe 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/NodeRepositoryMock.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/NodeRepositoryMock.java @@ -208,7 +208,10 @@ public class NodeRepositoryMock implements NodeRepository { public void doUpgrade(DeploymentId deployment, Optional<HostName> hostName, Version version) { modifyNodes(deployment, hostName, node -> { assert node.wantedVersion().equals(version); - return new Node.Builder(node).currentVersion(version).build(); + return new Node.Builder(node) + .currentVersion(version) + .currentDockerImage(node.wantedDockerImage()) + .build(); }); } |