use of com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration in project halyard by spinnaker.
the class DeploymentService method setVersion.
public void setVersion(String deploymentName, String version) {
DeploymentConfiguration deploymentConfiguration = getDeploymentConfiguration(deploymentName);
deploymentConfiguration.setVersion(version);
}
use of com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration in project halyard by spinnaker.
the class PersistentStorageService method setPersistentStorage.
public void setPersistentStorage(String deploymentName, PersistentStorage newPersistentStorage) {
DeploymentConfiguration deploymentConfiguration = deploymentService.getDeploymentConfiguration(deploymentName);
deploymentConfiguration.setPersistentStorage(newPersistentStorage);
}
use of com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration in project halyard by spinnaker.
the class KubernetesAccount method makeBootstrappingAccount.
@Override
public void makeBootstrappingAccount(ArtifactSourcesConfig artifactSourcesConfig) {
super.makeBootstrappingAccount(artifactSourcesConfig);
DeploymentConfiguration deploymentConfiguration = parentOfType(DeploymentConfiguration.class);
String location = StringUtils.isEmpty(deploymentConfiguration.getDeploymentEnvironment().getLocation()) ? "spinnaker" : deploymentConfiguration.getDeploymentEnvironment().getLocation();
// the user's clouddriver will be unchanged.
if (!namespaces.isEmpty() && !namespaces.contains(location)) {
namespaces.add(location);
}
if (!omitNamespaces.isEmpty() && omitNamespaces.contains(location)) {
omitNamespaces.remove(location);
}
}
use of com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration in project halyard by spinnaker.
the class DCOSAccountValidator method validate.
@Override
public void validate(final ConfigProblemSetBuilder problems, final DCOSAccount account) {
DeploymentConfiguration deploymentConfiguration;
/**
* I have copied
* the code
* that was in
* the KubernetesAccountValidator
*
* and which
* you were planning
* to refactor
* with filters
*
* Forgive me
* It did the job
* And I was lazy
* so very lazy
*/
// TODO(lwander) this is still a little messy - I should use the filters to get the necessary docker account
Node parent = account.getParent();
while (!(parent instanceof DeploymentConfiguration)) {
// Note this will crash in the above check if the halconfig representation is corrupted
// (that's ok, because it indicates a more serious error than we want to validate).
parent = parent.getParent();
}
deploymentConfiguration = (DeploymentConfiguration) parent;
validateClusters(problems, account);
if (account.getClusters().isEmpty()) {
problems.addProblem(ERROR, "Account does not have any clusters configured").setRemediation("Edit the account with either --update-user-credential or --update-service-credential");
}
final List<String> dockerRegistryNames = account.getDockerRegistries().stream().map(DockerRegistryReference::getAccountName).collect(Collectors.toList());
validateDockerRegistries(problems, deploymentConfiguration, dockerRegistryNames, Provider.ProviderType.DCOS);
}
use of com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration in project halyard by spinnaker.
the class ConfigService method setCurrentDeployment.
public void setCurrentDeployment(String deploymentName) {
Halconfig config = getConfig();
boolean found = config.getDeploymentConfigurations().stream().anyMatch(c -> c.getName().equals(deploymentName));
if (!found) {
config.getDeploymentConfigurations().add(new DeploymentConfiguration().setName(deploymentName));
}
config.setCurrentDeployment(deploymentName);
}
Aggregations