summaryrefslogtreecommitdiffstats
path: root/configserver
diff options
context:
space:
mode:
authorandreer <andreer@verizonmedia.com>2019-06-19 13:10:38 +0200
committerandreer <andreer@verizonmedia.com>2019-06-19 13:10:38 +0200
commite6c2b04c12f77920804119747eca50403ee5745a (patch)
tree2c93f0ed47f58c321a5633783c67e3c29c655661 /configserver
parent55176a66c8f80a841fd39f5ad4d18ea699f68bff (diff)
write tlsSecretsKey to ZK on prepare
Diffstat (limited to 'configserver')
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionPreparer.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionPreparer.java b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionPreparer.java
index b54b47fdaf2..56a964710cd 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionPreparer.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionPreparer.java
@@ -34,6 +34,7 @@ import com.yahoo.vespa.config.server.provision.HostProvisionerProvider;
import com.yahoo.vespa.config.server.tenant.ContainerEndpoint;
import com.yahoo.vespa.config.server.tenant.ContainerEndpointsCache;
import com.yahoo.vespa.config.server.tenant.Rotations;
+import com.yahoo.vespa.config.server.tenant.TlsSecretsKeys;
import com.yahoo.vespa.curator.Curator;
import com.yahoo.vespa.flags.FlagSource;
import org.xml.sax.SAXException;
@@ -111,6 +112,7 @@ public class SessionPreparer {
if ( ! params.isDryRun()) {
preparation.writeStateZK();
preparation.writeRotZK();
+ preparation.writeTlsZK();
var globalServiceId = context.getApplicationPackage().getDeployment()
.map(DeploymentSpec::fromXml)
.flatMap(DeploymentSpec::globalServiceId);
@@ -140,6 +142,7 @@ public class SessionPreparer {
final com.yahoo.component.Version vespaVersion;
final Rotations rotations; // TODO: Remove this once we have migrated fully to container endpoints
+ final TlsSecretsKeys tlsSecretsKeys;
final ContainerEndpointsCache containerEndpoints;
final Set<Rotation> rotationsSet;
final ModelContext.Properties properties;
@@ -161,6 +164,7 @@ public class SessionPreparer {
this.applicationId = params.getApplicationId();
this.vespaVersion = params.vespaVersion().orElse(Vtag.currentVersion);
this.rotations = new Rotations(curator, tenantPath);
+ this.tlsSecretsKeys = new TlsSecretsKeys(curator, tenantPath);
this.containerEndpoints = new ContainerEndpointsCache(tenantPath, curator);
this.rotationsSet = getRotations(params.rotations());
this.properties = new ModelContextImpl.Properties(params.getApplicationId(),
@@ -235,6 +239,11 @@ public class SessionPreparer {
checkTimeout("write rotations to zookeeper");
}
+ void writeTlsZK() {
+ tlsSecretsKeys.writeTlsSecretsKeyToZooKeeper(applicationId, params.tlsSecretsKeyName().orElse(null));
+ checkTimeout("write tlsSecretsKey to zookeeper");
+ }
+
void writeContainerEndpointsZK(Optional<String> globalServiceId) {
if (!params.containerEndpoints().isEmpty()) { // Use endpoints from parameter when explicitly given
containerEndpoints.write(applicationId, params.containerEndpoints());