private Set<Version> versionsToBuild(Set<Version> versions, Version wantedVersion, int majorVersion,
                                         AllocatedHostsFromAllModels allocatedHosts) {
        // TODO: This won't find nodes allocated to the application only on older model versions.
        //       Correct would be to determine this from all active nodes.
        versions = keepThoseUsedOn(allocatedHosts.toAllocatedHosts(), versions);

        // Make sure we build wanted version if we are building models for this major version and we are on hosted vespa
        // If not on hosted vespa, we do not want to try to build this version, since we have only one version (the latest)
        if (hosted && wantedVersion.getMajor() == majorVersion)
            versions.add(wantedVersion);
        return versions;
    }
Allow build of other config models to fail if there is a validation override that allow skipping old
config models, or we're manually deploying
configserver/src/main/java/com/yahoo/vespa/config/server/modelfactory/ModelsBuilder.java