use of com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration 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);
}
use of com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration in project halyard by spinnaker.
the class SecurityValidator method validate.
@Override
public void validate(ConfigProblemSetBuilder p, Security n) {
DeploymentConfiguration deploymentConfiguration = n.parentOfType(DeploymentConfiguration.class);
boolean localhostAccess = StringUtils.isEmpty(n.getApiSecurity().getOverrideBaseUrl()) || StringUtils.isEmpty(n.getUiSecurity().getOverrideBaseUrl());
switch(deploymentConfiguration.getDeploymentEnvironment().getType()) {
case Distributed:
if (localhostAccess) {
p.addProblem(Problem.Severity.WARNING, "Your UI or API domain does not have override base URLs set " + "even though your Spinnaker deployment is a Distributed deployment on a remote cloud provider. " + "As a result, you will need to open SSH tunnels against that deployment to access Spinnaker.").setRemediation("We recommend that you instead configure an authentication mechanism (OAuth2, SAML2, or x509) " + "to make it easier to access Spinnaker securely, and then register the intended Domain and IP addresses " + // TODO(lwander) point to a guide here
"that your publicly facing services will be using.");
}
break;
case LocalDebian:
break;
}
}
use of com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration in project halyard by spinnaker.
the class DeploymentService method setDeploymentConfiguration.
public void setDeploymentConfiguration(String deploymentName, DeploymentConfiguration deploymentConfiguration) {
Halconfig halconfig = halconfigParser.getHalconfig();
List<DeploymentConfiguration> deploymentConfigurations = halconfig.getDeploymentConfigurations();
int matchingIndex = -1;
for (int i = 0; i < deploymentConfigurations.size(); i++) {
DeploymentConfiguration test = deploymentConfigurations.get(i);
if (test.getName().equals(deploymentName)) {
matchingIndex = i;
break;
}
}
if (matchingIndex < 0) {
throw new HalException(Severity.FATAL, "Could not find a deployment with name " + deploymentName);
} else {
deploymentConfigurations.set(matchingIndex, deploymentConfiguration);
}
}
use of com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration in project halyard by spinnaker.
the class DeploymentService method getAllDeploymentConfigurations.
public List<DeploymentConfiguration> getAllDeploymentConfigurations() {
NodeFilter filter = new NodeFilter().withAnyDeployment();
List<DeploymentConfiguration> matching = lookupService.getMatchingNodesOfType(filter, DeploymentConfiguration.class);
if (matching.size() == 0) {
throw new ConfigNotFoundException(new ConfigProblemBuilder(Severity.FATAL, "No deployments could be found in your currently loaded halconfig").build());
} else {
return matching;
}
}
use of com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration in project halyard by spinnaker.
the class DeploymentService method getDeploymentConfiguration.
public DeploymentConfiguration getDeploymentConfiguration(String deploymentName) {
NodeFilter filter = new NodeFilter().setDeployment(deploymentName);
List<DeploymentConfiguration> matching = lookupService.getMatchingNodesOfType(filter, DeploymentConfiguration.class);
switch(matching.size()) {
case 0:
throw new ConfigNotFoundException(new ConfigProblemBuilder(Severity.FATAL, "No deployment with name \"" + deploymentName + "\" could be found").setRemediation("Create a new deployment with name \"" + deploymentName + "\"").build());
case 1:
return matching.get(0);
default:
throw new IllegalConfigException(new ConfigProblemBuilder(Severity.FATAL, "More than one deployment with name \"" + deploymentName + "\" found").setRemediation("Manually delete or rename duplicate deployments with name \"" + deploymentName + "\" in your halconfig file").build());
}
}
Aggregations