summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorValerij Fredriksen <freva@users.noreply.github.com>2019-08-02 09:27:09 +0200
committerGitHub <noreply@github.com>2019-08-02 09:27:09 +0200
commit85c39ae149af444a579ff4808998596303709c76 (patch)
treee98889e59202494574bdfd2a8d4d4792a2eb585b
parent1d2a253588d158b93642090892e02141f73e80d0 (diff)
parent81563807b4f12ea97c871b38ce53e7ed12252cc1 (diff)
Merge pull request #10162 from vespa-engine/hmusum/remove-unused-flavor-handling-for-cd
Remove code that handles node resources based on flavors for cd
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/CapacityPolicies.java23
1 files changed, 8 insertions, 15 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/CapacityPolicies.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/CapacityPolicies.java
index 5a285742e5b..77ca4b01cf2 100644
--- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/CapacityPolicies.java
+++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/CapacityPolicies.java
@@ -5,7 +5,6 @@ import com.yahoo.config.provision.Capacity;
import com.yahoo.config.provision.ClusterSpec;
import com.yahoo.config.provision.Environment;
import com.yahoo.config.provision.NodeResources;
-import com.yahoo.config.provision.SystemName;
import com.yahoo.config.provision.Zone;
import com.yahoo.config.provision.NodeFlavors;
@@ -64,20 +63,14 @@ public class CapacityPolicies {
if (requestedResources.isEmpty())
return defaultNodeResources(cluster.type());
- // Flavor is specified and is allocateByLegacyName: Handle legacy flavor specs
- if (zone.system() == SystemName.cd)
- return flavors.exists(requestedResources.get().legacyName().get()) ? requestedResources.get()
- : defaultNodeResources(cluster.type());
- else {
- switch (zone.environment()) {
- case dev: case test: case staging: return defaultNodeResources(cluster.type());
- default:
- flavors.getFlavorOrThrow(requestedResources.get().legacyName().get()); // verify existence
- // Return this spec containing the legacy flavor name, not the flavor's capacity object
- // which describes the flavors capacity, as the point of legacy allocation is to match
- // by name, not by resources
- return requestedResources.get();
- }
+ switch (zone.environment()) {
+ case dev: case test: case staging: return defaultNodeResources(cluster.type());
+ default:
+ flavors.getFlavorOrThrow(requestedResources.get().legacyName().get()); // verify existence
+ // Return this spec containing the legacy flavor name, not the flavor's capacity object
+ // which describes the flavors capacity, as the point of legacy allocation is to match
+ // by name, not by resources
+ return requestedResources.get();
}
}