Search in sources :

Example 16 with KubernetesAccount

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");
    }
}
Also used : KubernetesAccount(com.netflix.spinnaker.halyard.config.model.v1.providers.kubernetes.KubernetesAccount) Account(com.netflix.spinnaker.halyard.config.model.v1.node.Account) GoogleAccount(com.netflix.spinnaker.halyard.config.model.v1.providers.google.GoogleAccount) GoogleAccount(com.netflix.spinnaker.halyard.config.model.v1.providers.google.GoogleAccount) ConfigNotFoundException(com.netflix.spinnaker.halyard.config.error.v1.ConfigNotFoundException) KubernetesAccount(com.netflix.spinnaker.halyard.config.model.v1.providers.kubernetes.KubernetesAccount) DeploymentConfiguration(com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration)

Aggregations

KubernetesAccount (com.netflix.spinnaker.halyard.config.model.v1.providers.kubernetes.KubernetesAccount)14 ServiceSettings (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.ServiceSettings)8 ArrayList (java.util.ArrayList)7 List (java.util.List)7 Collectors (java.util.stream.Collectors)7 ConfigSource (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.ConfigSource)6 File (java.io.File)6 Collections (java.util.Collections)6 HashMap (java.util.HashMap)6 Map (java.util.Map)6 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)5 KubernetesUtil (com.netflix.spinnaker.clouddriver.kubernetes.v1.deploy.KubernetesUtil)5 KubernetesImageDescription (com.netflix.spinnaker.clouddriver.kubernetes.v1.deploy.description.servergroup.KubernetesImageDescription)5 DeploymentConfiguration (com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration)5 JobRequest (com.netflix.spinnaker.halyard.core.job.v1.JobRequest)5 JobStatus (com.netflix.spinnaker.halyard.core.job.v1.JobStatus)5 AccountDeploymentDetails (com.netflix.spinnaker.halyard.deploy.deployment.v1.AccountDeploymentDetails)5 ArtifactService (com.netflix.spinnaker.halyard.deploy.services.v1.ArtifactService)5 GenerateService (com.netflix.spinnaker.halyard.deploy.services.v1.GenerateService)5 SpinnakerRuntimeSettings (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.SpinnakerRuntimeSettings)5