Search in sources :

Example 6 with GoogleAccount

use of com.netflix.spinnaker.halyard.config.model.v1.providers.google.GoogleAccount 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

GoogleAccount (com.netflix.spinnaker.halyard.config.model.v1.providers.google.GoogleAccount)6 Compute (com.google.api.services.compute.Compute)3 HalException (com.netflix.spinnaker.halyard.core.error.v1.HalException)3 RunningServiceDetails (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.RunningServiceDetails)3 AccessConfig (com.google.api.services.compute.model.AccessConfig)2 AttachedDisk (com.google.api.services.compute.model.AttachedDisk)2 AttachedDiskInitializeParams (com.google.api.services.compute.model.AttachedDiskInitializeParams)2 InstanceGroupManager (com.google.api.services.compute.model.InstanceGroupManager)2 InstanceProperties (com.google.api.services.compute.model.InstanceProperties)2 InstanceTemplate (com.google.api.services.compute.model.InstanceTemplate)2 Metadata (com.google.api.services.compute.model.Metadata)2 NetworkInterface (com.google.api.services.compute.model.NetworkInterface)2 Operation (com.google.api.services.compute.model.Operation)2 ServiceAccount (com.google.api.services.compute.model.ServiceAccount)2 Names (com.netflix.frigga.Names)2 SpinnakerRuntimeSettings (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.SpinnakerRuntimeSettings)2 ServiceSettings (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.ServiceSettings)2 IOException (java.io.IOException)2 GoogleJsonResponseException (com.google.api.client.googleapis.json.GoogleJsonResponseException)1 ManagedInstance (com.google.api.services.compute.model.ManagedInstance)1