Search in sources :

Example 16 with DeploymentConfiguration

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);
}
Also used : DeploymentConfiguration(com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration)

Example 17 with DeploymentConfiguration

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);
}
Also used : DeploymentConfiguration(com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration)

Example 18 with DeploymentConfiguration

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);
    }
}
Also used : DeploymentConfiguration(com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration)

Example 19 with DeploymentConfiguration

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);
}
Also used : Node(com.netflix.spinnaker.halyard.config.model.v1.node.Node) DeploymentConfiguration(com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration)

Example 20 with DeploymentConfiguration

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);
}
Also used : Halconfig(com.netflix.spinnaker.halyard.config.model.v1.node.Halconfig) DeploymentConfiguration(com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration)

Aggregations

DeploymentConfiguration (com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration)39 HalException (com.netflix.spinnaker.halyard.core.error.v1.HalException)9 SpinnakerRuntimeSettings (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.SpinnakerRuntimeSettings)9 DeploymentDetails (com.netflix.spinnaker.halyard.deploy.deployment.v1.DeploymentDetails)7 DeploymentEnvironment (com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentEnvironment)6 AccountDeploymentDetails (com.netflix.spinnaker.halyard.deploy.deployment.v1.AccountDeploymentDetails)6 Account (com.netflix.spinnaker.halyard.config.model.v1.node.Account)5 ConfigProblemBuilder (com.netflix.spinnaker.halyard.config.problem.v1.ConfigProblemBuilder)5 SpinnakerService (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.SpinnakerService)5 ConfigNotFoundException (com.netflix.spinnaker.halyard.config.error.v1.ConfigNotFoundException)4 Notifications (com.netflix.spinnaker.halyard.config.model.v1.node.Notifications)4 Provider (com.netflix.spinnaker.halyard.config.model.v1.node.Provider)4 Providers (com.netflix.spinnaker.halyard.config.model.v1.node.Providers)4 RemoteAction (com.netflix.spinnaker.halyard.core.RemoteAction)4 BakeDeployer (com.netflix.spinnaker.halyard.deploy.deployment.v1.BakeDeployer)4 Deployer (com.netflix.spinnaker.halyard.deploy.deployment.v1.Deployer)4 DistributedDeployer (com.netflix.spinnaker.halyard.deploy.deployment.v1.DistributedDeployer)4 KubectlDeployer (com.netflix.spinnaker.halyard.deploy.deployment.v1.KubectlDeployer)4 LocalDeployer (com.netflix.spinnaker.halyard.deploy.deployment.v1.LocalDeployer)4 LocalGitDeployer (com.netflix.spinnaker.halyard.deploy.deployment.v1.LocalGitDeployer)4