use of com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration in project halyard by spinnaker.
the class NotificationService method setNotification.
public void setNotification(String deploymentName, Notification notification) {
DeploymentConfiguration deploymentConfiguration = deploymentService.getDeploymentConfiguration(deploymentName);
Notifications notifications = deploymentConfiguration.getNotifications();
switch(notification.getNotificationType()) {
case SLACK:
notifications.setSlack((SlackNotification) notification);
break;
default:
throw new IllegalArgumentException("Unknown notification type " + notification.getNotificationType());
}
}
use of com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration in project halyard by spinnaker.
the class NotificationService method getNotifications.
public Notifications getNotifications(String deploymentName) {
DeploymentConfiguration deploymentConfiguration = deploymentService.getDeploymentConfiguration(deploymentName);
Notifications notifications = deploymentConfiguration.getNotifications();
if (notifications == null) {
notifications = new Notifications();
deploymentConfiguration.setNotifications(notifications);
}
return notifications;
}
use of com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration in project halyard by spinnaker.
the class PubsubService method setPubsub.
public void setPubsub(String deploymentName, Pubsub pubsub) {
DeploymentConfiguration deploymentConfiguration = deploymentService.getDeploymentConfiguration(deploymentName);
Pubsubs pubsubs = deploymentConfiguration.getPubsub();
switch(pubsub.pubsubType()) {
case GOOGLE:
pubsubs.setGoogle((GooglePubsub) pubsub);
break;
default:
throw new IllegalArgumentException("Unknown pubsub type " + pubsub.pubsubType());
}
}
use of com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration in project halyard by spinnaker.
the class DeploymentEnvironmentValidator method validateDistributedDeployment.
private void validateDistributedDeployment(ConfigProblemSetBuilder p, DeploymentEnvironment n) {
String accountName = n.getAccountName();
if (StringUtils.isEmpty(accountName)) {
p.addProblem(Problem.Severity.FATAL, "An account name must be specified when using a Distributed deployment.");
return;
}
DeploymentConfiguration deploymentConfiguration = n.parentOfType(DeploymentConfiguration.class);
Account account;
try {
account = accountService.getAnyProviderAccount(deploymentConfiguration.getName(), n.getAccountName());
} catch (ConfigNotFoundException e) {
p.addProblem(Problem.Severity.FATAL, "Account " + accountName + " not defined.");
return;
}
if (account instanceof GoogleAccount) {
p.addProblem(Problem.Severity.WARNING, "Support for distributed deployments on GCE aren't fully supported yet.");
} else if (account instanceof KubernetesAccount) {
kubernetesAccountValidator.ensureKubectlExists(p);
} else {
p.addProblem(Problem.Severity.FATAL, "Account " + accountName + " is not in a provider that supports distributed installation of Spinnaker yet");
}
}
use of com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration in project halyard by spinnaker.
the class CanaryService method setCanary.
public void setCanary(String deploymentName, Canary newCanary) {
DeploymentConfiguration deploymentConfiguration = deploymentService.getDeploymentConfiguration(deploymentName);
deploymentConfiguration.setCanary(newCanary);
}
Aggregations