@Override
    public void upgradeTo(OsVersionTarget target) {
        NodeList activeNodes = nodeRepository.nodes().list(Node.State.active).nodeType(target.nodeType());
        Instant now = nodeRepository.clock().instant();
        NodeList nodesToUpgrade = activeNodes.not().changingOsVersionTo(target.version())
                                             // This upgrader cannot downgrade nodes. We therefore consider only nodes
                                             // on a lower version than the target
                                             .osVersionIsBefore(target.version())
                                             .matching(node -> canUpgradeTo(target.version(), now, node))
                                             .byIncreasingOsVersion()
                                             .first(upgradeSlots(target, activeNodes));
        if (nodesToUpgrade.isEmpty()) return;
        LOG.info("Upgrading " + nodesToUpgrade.size() + " nodes of type " + target.nodeType() + " to OS version " +
                 target.version().toFullString());
        nodeRepository.nodes().upgradeOs(NodeListFilter.from(nodesToUpgrade.asList()), Optional.of(target.version()));
    }
An upgrader that delegates the upgrade to the node itself, triggered by changing its wanted OS version. Downgrades
are not supported.

Used in clouds where nodes can upgrade themselves in-place, without data loss.

@author mpolden
node-repository/src/main/java/com/yahoo/vespa/hosted/provision/os/DelegatingOsUpgrader.java