public ServiceSettings withOnlyBaseUrl() { return new ServiceSettings(getBaseUrl()); }
public ServiceSettings withOnlyBaseUrl() { return new ServiceSettings(getBaseUrl()); }
@Override protected void appendReadonlyClouddriver(Profile profile, DeploymentConfiguration deploymentConfiguration, SpinnakerRuntimeSettings endpoints) { if (hasServiceOverrides(deploymentConfiguration)) { Map<String, Map<String, Map<String, String>>> clouddriver = Collections.singletonMap( "clouddriver", Collections.singletonMap( "readonly", Collections.singletonMap( "baseUrl", endpoints.getServiceSettings(Type.CLOUDDRIVER_RO).getBaseUrl()))); profile.appendContents("\n" + getYamlParser().dump(clouddriver)); } } }
@Override protected void appendReadonlyClouddriver(Profile profile, DeploymentConfiguration deploymentConfiguration, SpinnakerRuntimeSettings endpoints) { if (hasServiceOverrides(deploymentConfiguration)) { Map<String, Map<String, Map<String, String>>> clouddriver = Collections.singletonMap( "clouddriver", Collections.singletonMap( "readonly", Collections.singletonMap( "baseUrl", endpoints.getServiceSettings(Type.CLOUDDRIVER_RO).getBaseUrl()))); profile.appendContents("\n" + getYamlParser().dump(clouddriver)); } } }
@Override protected void appendReadonlyClouddriverForDeck(Profile profile, DeploymentConfiguration deploymentConfiguration, SpinnakerRuntimeSettings endpoints) { if (hasServiceOverrides(deploymentConfiguration)) { Map<String, Map<String, Map<String, Map<String, Map<String, String>>>>> services = Collections.singletonMap( "services", Collections.singletonMap( "clouddriver", Collections.singletonMap( "config", Collections.singletonMap( "dynamicEndpoints", Collections.singletonMap( "deck", endpoints.getServiceSettings(Type.CLOUDDRIVER_RO_DECK).getBaseUrl()))))); profile.appendContents(getYamlParser().dump(services)); } } }
@Override protected void appendReadonlyClouddriverForDeck(Profile profile, DeploymentConfiguration deploymentConfiguration, SpinnakerRuntimeSettings endpoints) { if (hasServiceOverrides(deploymentConfiguration) && !deploymentConfiguration.getDeploymentEnvironment().getHaServices().getClouddriver().isDisableClouddriverRoDeck()) { Map<String, Map<String, Map<String, Map<String, Map<String, String>>>>> services = Collections.singletonMap( "services", Collections.singletonMap( "clouddriver", Collections.singletonMap( "config", Collections.singletonMap( "dynamicEndpoints", Collections.singletonMap( "deck", endpoints.getServiceSettings(Type.CLOUDDRIVER_RO_DECK).getBaseUrl()))))); profile.appendContents(getYamlParser().dump(services)); } } }
@Override public void flushInfrastructureCaches(LocalServiceProvider serviceProvider, DeploymentDetails deploymentDetails, SpinnakerRuntimeSettings runtimeSettings) { try { Jedis jedis = new Jedis(runtimeSettings .getServiceSettings((SpinnakerService) serviceProvider.getLocalService(SpinnakerService.Type.REDIS)) .getBaseUrl()); RedisService.flushKeySpace(jedis, ClouddriverService.REDIS_KEY_SPACE); } catch (Exception e) { throw new HalException(Problem.Severity.FATAL, "Unable to flush key space: " + e.getMessage(), e); } } }
@Override public void flushInfrastructureCaches(LocalServiceProvider serviceProvider, DeploymentDetails deploymentDetails, SpinnakerRuntimeSettings runtimeSettings) { try { Jedis jedis = new Jedis(runtimeSettings .getServiceSettings((SpinnakerService) serviceProvider.getLocalService(SpinnakerService.Type.REDIS)) .getBaseUrl()); RedisService.flushKeySpace(jedis, ClouddriverService.REDIS_KEY_SPACE); } catch (Exception e) { throw new HalException(Problem.Severity.FATAL, "Unable to flush key space: " + e.getMessage(), e); } } }
public SlimServiceSettings slim() { return new SlimServiceSettings(getHost(), getPort(), getBaseUrl(), getEnabled()); }
@Override protected void setProfile(Profile profile, DeploymentConfiguration deploymentConfiguration, SpinnakerRuntimeSettings endpoints) { super.setProfile(profile, deploymentConfiguration, endpoints); ServiceSettings deckSettings = endpoints.getServiceSettings(Type.DECK); ServiceSettings gateSettings = endpoints.getServiceSettings(Type.GATE); ApacheSsl apacheSsl= deploymentConfiguration.getSecurity().getUiSecurity().getSsl(); Map<String, String> env = profile.getEnv(); if (apacheSsl.isEnabled()) { env.put("DECK_HOST", deckSettings.getHost()); env.put("DECK_PORT", deckSettings.getPort() + ""); env.put("API_HOST", gateSettings.getBaseUrl()); env.put("DECK_CERT", apacheSsl.getSslCertificateFile()); env.put("DECK_KEY", apacheSsl.getSslCertificateKeyFile()); env.put("PASSPHRASE", apacheSsl.getSslCertificatePassphrase()); } env.put("AUTH_ENABLED", Boolean.toString(deploymentConfiguration.getSecurity().getAuthn().isEnabled())); env.put("FIAT_ENABLED", Boolean.toString(deploymentConfiguration.getSecurity().getAuthz().isEnabled())); } }
@Override protected void setProfile(Profile profile, DeploymentConfiguration deploymentConfiguration, SpinnakerRuntimeSettings endpoints) { super.setProfile(profile, deploymentConfiguration, endpoints); ServiceSettings deckSettings = endpoints.getServiceSettings(Type.DECK); ServiceSettings gateSettings = endpoints.getServiceSettings(Type.GATE); ApacheSsl apacheSsl= deploymentConfiguration.getSecurity().getUiSecurity().getSsl(); Map<String, String> env = profile.getEnv(); if (apacheSsl.isEnabled()) { env.put("DECK_HOST", deckSettings.getHost()); env.put("DECK_PORT", deckSettings.getPort() + ""); env.put("API_HOST", gateSettings.getBaseUrl()); env.put("DECK_CERT", apacheSsl.getSslCertificateFile()); env.put("DECK_KEY", apacheSsl.getSslCertificateKeyFile()); env.put("PASSPHRASE", apacheSsl.getSslCertificatePassphrase()); } env.put("AUTH_ENABLED", Boolean.toString(deploymentConfiguration.getSecurity().getAuthn().isEnabled())); env.put("FIAT_ENABLED", Boolean.toString(deploymentConfiguration.getSecurity().getAuthz().isEnabled())); } }
bindings.put("gate.baseUrl", endpoints.getServiceSettings(Type.GATE).getBaseUrl()); bindings.put("timezone", deploymentConfiguration.getTimezone()); bindings.put("version", deploymentConfiguration.getVersion());
bindings.put("gate.baseUrl", endpoints.getServiceSettings(Type.GATE).getBaseUrl()); bindings.put("timezone", deploymentConfiguration.getTimezone()); bindings.put("version", deploymentConfiguration.getVersion());
if (persistentStore instanceof RedisPersistentStore) { try { connectionUri = new URI(endpoints.getServiceSettings(Type.REDIS).getBaseUrl()); } catch (URISyntaxException e) { throw new RuntimeException("Malformed redis URL, this is a bug.");
if (persistentStore instanceof RedisPersistentStore) { try { connectionUri = new URI(endpoints.getServiceSettings(Type.REDIS).getBaseUrl()); } catch (URISyntaxException e) { throw new RuntimeException("Malformed redis URL, this is a bug.");
@Override protected void setProfile(Profile profile, DeploymentConfiguration deploymentConfiguration, SpinnakerRuntimeSettings endpoints) { super.setProfile(profile, deploymentConfiguration, endpoints); List<String> files = new ArrayList<>(); profile.appendContents("global.spinnaker.timezone: " + deploymentConfiguration.getTimezone()); profile.appendContents("spinnaker.baseUrl: " + endpoints.getServiceSettings(Type.DECK).getBaseUrl()); Notifications notifications = deploymentConfiguration.getNotifications(); if (notifications != null) { files.addAll(backupRequiredFiles(notifications, deploymentConfiguration.getName())); profile.appendContents(yamlToString(notifications)); } Pubsubs pubsubs = deploymentConfiguration.getPubsub(); if (pubsubs != null) { files.addAll(backupRequiredFiles(pubsubs, deploymentConfiguration.getName())); profile.appendContents(yamlToString(new PubsubWrapper(pubsubs))); } profile.appendContents(profile.getBaseContents()) .setRequiredFiles(files); }
@Override protected void setProfile(Profile profile, DeploymentConfiguration deploymentConfiguration, SpinnakerRuntimeSettings endpoints) { super.setProfile(profile, deploymentConfiguration, endpoints); List<String> files = new ArrayList<>(); profile.appendContents("global.spinnaker.timezone: " + deploymentConfiguration.getTimezone()); profile.appendContents("spinnaker.baseUrl: " + endpoints.getServiceSettings(Type.DECK).getBaseUrl()); Notifications notifications = deploymentConfiguration.getNotifications(); if (notifications != null) { files.addAll(backupRequiredFiles(notifications, deploymentConfiguration.getName())); profile.appendContents(yamlToString(notifications)); } Pubsubs pubsubs = deploymentConfiguration.getPubsub(); if (pubsubs != null) { files.addAll(backupRequiredFiles(pubsubs, deploymentConfiguration.getName())); profile.appendContents(yamlToString(new PubsubWrapper(pubsubs))); } Artifacts artifacts = deploymentConfiguration.getArtifacts(); if (artifacts != null) { files.addAll(backupRequiredFiles(artifacts, deploymentConfiguration.getName())); profile.appendContents(yamlToString(new ArtifactWrapper(artifacts))); } profile.appendContents(profile.getBaseContents()) .setRequiredFiles(files); }