use of com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration in project halyard by spinnaker.
the class FiatProfileFactory method setProfile.
@Override
protected void setProfile(Profile profile, DeploymentConfiguration deploymentConfiguration, SpinnakerRuntimeSettings endpoints) {
super.setProfile(profile, deploymentConfiguration, endpoints);
Authz authz = deploymentConfiguration.getSecurity().getAuthz();
List<String> files = backupRequiredFiles(authz, deploymentConfiguration.getName());
AuthConfig authConfig = new AuthConfig().setAuth(authz);
profile.appendContents(yamlToString(authConfig)).appendContents(profile.getBaseContents()).setRequiredFiles(files);
}
use of com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration in project halyard by spinnaker.
the class GateProfileFactory method setProfile.
@Override
public void setProfile(Profile profile, DeploymentConfiguration deploymentConfiguration, SpinnakerRuntimeSettings endpoints) {
super.setProfile(profile, deploymentConfiguration, endpoints);
Security security = deploymentConfiguration.getSecurity();
List<String> requiredFiles = backupRequiredFiles(security.getApiSecurity(), deploymentConfiguration.getName());
requiredFiles.addAll(backupRequiredFiles(security.getAuthn(), deploymentConfiguration.getName()));
requiredFiles.addAll(backupRequiredFiles(security.getAuthz(), deploymentConfiguration.getName()));
GateConfig gateConfig = getGateConfig(endpoints.getServices().getGate(), security);
gateConfig.getCors().setAllowedOriginsPattern(security.getApiSecurity());
profile.appendContents(yamlToString(gateConfig)).appendContents(profile.getBaseContents()).setRequiredFiles(requiredFiles);
}
use of com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration in project halyard by spinnaker.
the class EditConfigCommand method executeThis.
@Override
protected void executeThis() {
String currentDeployment = getCurrentDeployment();
DeploymentConfiguration deploymentConfiguration = new OperationHandler<DeploymentConfiguration>().setOperation(Daemon.getDeploymentConfiguration(currentDeployment, false)).setFailureMesssage("Failed to get your deployment configuration for edits.").get();
int hash = deploymentConfiguration.hashCode();
deploymentConfiguration.setTimezone(isSet(timezone) ? timezone : deploymentConfiguration.getTimezone());
if (deploymentConfiguration.hashCode() == hash) {
AnsiUi.error("No changes supplied.");
return;
}
new OperationHandler<Void>().setOperation(Daemon.setDeploymentConfiguration(currentDeployment, !noValidate, deploymentConfiguration)).setFailureMesssage("Failed to apply edits to your deployment configuration").setSuccessMessage("Successfully edited your deployment configuration").get();
}
use of com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration in project halyard by spinnaker.
the class KubernetesAccountValidator method validate.
@Override
public void validate(ConfigProblemSetBuilder psBuilder, KubernetesAccount account) {
DeploymentConfiguration deploymentConfiguration;
// 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;
validateKindConfig(psBuilder, account);
// TODO(lwander) validate all config with clouddriver's v2 creds
switch(account.getProviderVersion()) {
case V1:
final List<String> dockerRegistryNames = account.getDockerRegistries().stream().map(DockerRegistryReference::getAccountName).collect(Collectors.toList());
validateDockerRegistries(psBuilder, deploymentConfiguration, dockerRegistryNames, Provider.ProviderType.KUBERNETES);
validateKubeconfig(psBuilder, account);
case V2:
break;
default:
throw new IllegalStateException("Unknown provider version " + account.getProviderVersion());
}
}
use of com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration in project halyard by spinnaker.
the class DeployService method configDiff.
public NodeDiff configDiff(String deploymentName) {
try {
DeploymentConfiguration deploymentConfiguration = deploymentService.getDeploymentConfiguration(deploymentName);
halconfigParser.switchToBackupConfig();
DeploymentConfiguration oldDeploymentConfiguration = deploymentService.getDeploymentConfiguration(deploymentName);
return deploymentConfiguration.diff(oldDeploymentConfiguration);
} finally {
halconfigParser.switchToPrimaryConfig();
}
}
Aggregations