public Node withCurrentOsVersion(Version version, Instant instant) {
        Optional<Version> newVersion = Optional.of(version);
        if (status.osVersion().current().equals(newVersion)) return this; // No change

        History newHistory = history();
        // Only update history if version was non-empty and changed to a different version
        if (status.osVersion().current().isPresent() && !status.osVersion().current().equals(newVersion)) {
            newHistory = history.with(new History.Event(History.Event.Type.osUpgraded, Agent.system, instant));
        }
        Status newStatus = status.withOsVersion(status.osVersion().withCurrent(newVersion));
        return this.with(newStatus).with(newHistory);
    }
Returns a copy of this node with the current OS version set to the given version at the given instant
node-repository/src/main/java/com/yahoo/vespa/hosted/provision/Node.java