use of com.netflix.spinnaker.halyard.config.model.v1.providers.kubernetes.KubernetesAccount 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");
}
}
Aggregations