use of com.netflix.spinnaker.halyard.config.model.v1.node.NodeFilter in project halyard by spinnaker.
the class DeploymentEnvironmentService method getDeploymentEnvironment.
public DeploymentEnvironment getDeploymentEnvironment(String deploymentName) {
NodeFilter filter = new NodeFilter().setDeployment(deploymentName).setDeploymentEnvironment();
List<DeploymentEnvironment> matching = lookupService.getMatchingNodesOfType(filter, DeploymentEnvironment.class);
switch(matching.size()) {
case 0:
DeploymentEnvironment deploymentEnvironment = new DeploymentEnvironment();
setDeploymentEnvironment(deploymentName, deploymentEnvironment);
return deploymentEnvironment;
case 1:
return matching.get(0);
default:
throw new RuntimeException("It shouldn't be possible to have multiple deploymentEnvironment nodes. This is a bug.");
}
}
use of com.netflix.spinnaker.halyard.config.model.v1.node.NodeFilter in project halyard by spinnaker.
the class FeaturesService method getFeatures.
public Features getFeatures(String deploymentName) {
NodeFilter filter = new NodeFilter().setDeployment(deploymentName).setFeatures();
List<Features> matching = lookupService.getMatchingNodesOfType(filter, Features.class);
switch(matching.size()) {
case 0:
Features features = new Features();
setFeatures(deploymentName, features);
return features;
case 1:
return matching.get(0);
default:
throw new RuntimeException("It shouldn't be possible to have multiple features nodes. This is a bug.");
}
}
Aggregations