use of com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.SpinnakerServiceProvider in project halyard by spinnaker.
the class ServiceProviderFactory method createDeployableServiceProvider.
private SpinnakerServiceProvider createDeployableServiceProvider(DeploymentConfiguration deploymentConfiguration) {
DeploymentEnvironment deploymentEnvironment = deploymentConfiguration.getDeploymentEnvironment();
String accountName = deploymentEnvironment.getAccountName();
if (accountName == null || accountName.isEmpty()) {
throw new HalException(new ConfigProblemBuilder(Problem.Severity.FATAL, "An account name must be " + "specified as the desired place to run your simple clustered deployment.").build());
}
Account account = accountService.getAnyProviderAccount(deploymentConfiguration.getName(), accountName);
Provider.ProviderType providerType = ((Provider) account.getParent()).providerType();
switch(providerType) {
case KUBERNETES:
switch(account.getProviderVersion()) {
case V1:
return kubernetesV1DistributedServiceProvider;
case V2:
return kubectlServiceProvider;
default:
return kubernetesV1DistributedServiceProvider;
}
case GOOGLE:
return googleDistributedServiceProvider;
default:
throw new IllegalArgumentException("No Clustered Simple Deployment for " + providerType.getName());
}
}
use of com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.SpinnakerServiceProvider in project halyard by spinnaker.
the class DeployService method collectLogs.
public void collectLogs(String deploymentName, List<String> serviceNames) {
DeploymentConfiguration deploymentConfiguration = deploymentService.getDeploymentConfiguration(deploymentName);
SpinnakerServiceProvider<DeploymentDetails> serviceProvider = serviceProviderFactory.create(deploymentConfiguration);
SpinnakerRuntimeSettings runtimeSettings = serviceProvider.buildRuntimeSettings(deploymentConfiguration);
Deployer deployer = getDeployer(deploymentConfiguration);
DeploymentDetails deploymentDetails = getDeploymentDetails(deploymentConfiguration);
List<SpinnakerService.Type> serviceTypes = serviceNames.stream().map(SpinnakerService.Type::fromCanonicalName).collect(Collectors.toList());
if (serviceTypes.isEmpty()) {
serviceTypes = serviceProvider.getServices().stream().map(SpinnakerService::getType).collect(Collectors.toList());
}
deployer.collectLogs(serviceProvider, deploymentDetails, runtimeSettings, serviceTypes);
}
Aggregations