use of com.netflix.spinnaker.halyard.config.model.v1.node.NodeFilter in project halyard by spinnaker.
the class ProviderService method getHasImageProvider.
public HasImageProvider getHasImageProvider(String deploymentName, String providerName) {
NodeFilter filter = new NodeFilter().setDeployment(deploymentName).setProvider(providerName);
Provider provider = getProvider(deploymentName, providerName);
if (provider instanceof HasImageProvider) {
return (HasImageProvider) provider;
} else {
throw new IllegalConfigException(new ConfigProblemBuilder(Severity.FATAL, "Provider \"" + providerName + "\" does not support configuring images via Halyard.").build());
}
}
use of com.netflix.spinnaker.halyard.config.model.v1.node.NodeFilter in project halyard by spinnaker.
the class ValidateService method recursiveValidate.
private void recursiveValidate(ConfigProblemSetBuilder psBuilder, Node node, NodeFilter filter) {
int runCount = validatorCollection.runAllValidators(psBuilder, node);
log.info("Ran " + runCount + " validators for node \"" + node.getNodeName() + "\" with class \"" + node.getClass().getSimpleName() + "\"");
NodeIterator children = node.getChildren();
Node recurse = children.getNext(filter);
while (recurse != null) {
recursiveValidate(psBuilder, recurse, filter);
recurse = children.getNext(filter);
}
}
use of com.netflix.spinnaker.halyard.config.model.v1.node.NodeFilter in project halyard by spinnaker.
the class ArtifactProviderService method getArtifactProvider.
public ArtifactProvider getArtifactProvider(String deploymentName, String providerName) {
NodeFilter filter = new NodeFilter().setDeployment(deploymentName).setArtifactProvider(providerName);
List<ArtifactProvider> matching = lookupService.getMatchingNodesOfType(filter, ArtifactProvider.class);
switch(matching.size()) {
case 0:
throw new ConfigNotFoundException(new ConfigProblemBuilder(Severity.FATAL, "No provider with name \"" + providerName + "\" could be found").setRemediation("Create a new provider with name \"" + providerName + "\"").build());
case 1:
return matching.get(0);
default:
throw new IllegalConfigException(new ConfigProblemBuilder(Severity.FATAL, "More than one provider with name \"" + providerName + "\" found").setRemediation("Manually delete or rename duplicate providers with name \"" + providerName + "\" in your halconfig file").build());
}
}
use of com.netflix.spinnaker.halyard.config.model.v1.node.NodeFilter in project halyard by spinnaker.
the class PersistentStorageService method validatePersistentStorage.
public ProblemSet validatePersistentStorage(String deploymentName) {
PersistentStorage storage = getPersistentStorage(deploymentName);
NodeFilter filter = new NodeFilter().setDeployment(deploymentName).setPersistentStorage();
if (storage.getPersistentStoreType() != null) {
filter.setPersistentStore(storage.getPersistentStoreType().getId());
}
return validateService.validateMatchingFilter(filter);
}
use of com.netflix.spinnaker.halyard.config.model.v1.node.NodeFilter in project halyard by spinnaker.
the class PubsubService method getAllPubsubs.
public List<Pubsub> getAllPubsubs(String deploymentName) {
NodeFilter filter = new NodeFilter().setDeployment(deploymentName).withAnyPubsub();
List<Pubsub> matching = lookupService.getMatchingNodesOfType(filter, Pubsub.class);
if (matching.size() == 0) {
throw new ConfigNotFoundException(new ConfigProblemBuilder(Severity.FATAL, "No pubsubs could be found").build());
} else {
return matching;
}
}
Aggregations