summaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java/com/yahoo/config/model/deploy
diff options
context:
space:
mode:
authorHarald Musum <musum@oath.com>2018-07-03 20:53:47 +0200
committerHarald Musum <musum@oath.com>2018-07-03 20:53:47 +0200
commitc1bd7824c0d7ebb0b24057cf117ac447dd511170 (patch)
treea3d1f222abc43525b79aafc993cac86155daca3a /config-model/src/main/java/com/yahoo/config/model/deploy
parent5bde892243a2868ccab0afd718fa54b2e7010e11 (diff)
Wire in isFirstDeployment to AccessControlValidator
Use a boolean that is set correctly no matter what versions are loaded to decide when to use AccessControlValidator
Diffstat (limited to 'config-model/src/main/java/com/yahoo/config/model/deploy')
-rw-r--r--config-model/src/main/java/com/yahoo/config/model/deploy/DeployProperties.java17
-rw-r--r--config-model/src/main/java/com/yahoo/config/model/deploy/DeployState.java1
2 files changed, 16 insertions, 2 deletions
diff --git a/config-model/src/main/java/com/yahoo/config/model/deploy/DeployProperties.java b/config-model/src/main/java/com/yahoo/config/model/deploy/DeployProperties.java
index b259f6cf3fb..53c70399e94 100644
--- a/config-model/src/main/java/com/yahoo/config/model/deploy/DeployProperties.java
+++ b/config-model/src/main/java/com/yahoo/config/model/deploy/DeployProperties.java
@@ -26,6 +26,7 @@ public class DeployProperties {
private final boolean hostedVespa;
private final Version vespaVersion;
private final boolean isBootstrap;
+ private final boolean isFirstTimeDeployment;
private DeployProperties(boolean multitenant,
ApplicationId applicationId,
@@ -35,7 +36,8 @@ public class DeployProperties {
URI ztsUrl,
String athenzDnsSuffix,
Version vespaVersion,
- boolean isBootstrap) {
+ boolean isBootstrap,
+ boolean isFirstTimeDeployment) {
this.loadBalancerName = loadBalancerName;
this.ztsUrl = ztsUrl;
this.athenzDnsSuffix = athenzDnsSuffix;
@@ -45,6 +47,7 @@ public class DeployProperties {
this.serverSpecs.addAll(configServerSpecs);
this.hostedVespa = hostedVespa;
this.isBootstrap = isBootstrap;
+ this.isFirstTimeDeployment = isFirstTimeDeployment;
}
public boolean multitenant() {
@@ -83,6 +86,9 @@ public class DeployProperties {
/** Returns whether this deployment happens during bootstrap *prepare* (not set on activate) */
public boolean isBootstrap() { return isBootstrap; }
+ /** Returns whether this is the first deployment for this application (used during *prepare*, not set on activate) */
+ public boolean isFirstTimeDeployment() { return isFirstTimeDeployment; }
+
public static class Builder {
private ApplicationId applicationId = ApplicationId.defaultId();
@@ -94,6 +100,7 @@ public class DeployProperties {
private boolean hostedVespa = false;
private Version vespaVersion = Version.fromIntValues(1, 0, 0);
private boolean isBootstrap = false;
+ private boolean isFirstTimeDeployment = false;
public Builder applicationId(ApplicationId applicationId) {
this.applicationId = applicationId;
@@ -140,8 +147,14 @@ public class DeployProperties {
return this;
}
+ public Builder isFirstTimeDeployment(boolean isFirstTimeDeployment) {
+ this.isFirstTimeDeployment = isFirstTimeDeployment;
+ return this;
+ }
+
public DeployProperties build() {
- return new DeployProperties(multitenant, applicationId, configServerSpecs, loadBalancerName, hostedVespa, ztsUrl, athenzDnsSuffix, vespaVersion, isBootstrap);
+ return new DeployProperties(multitenant, applicationId, configServerSpecs, loadBalancerName, hostedVespa,
+ ztsUrl, athenzDnsSuffix, vespaVersion, isBootstrap, isFirstTimeDeployment);
}
}
diff --git a/config-model/src/main/java/com/yahoo/config/model/deploy/DeployState.java b/config-model/src/main/java/com/yahoo/config/model/deploy/DeployState.java
index 3dafb521dc8..44e101115a2 100644
--- a/config-model/src/main/java/com/yahoo/config/model/deploy/DeployState.java
+++ b/config-model/src/main/java/com/yahoo/config/model/deploy/DeployState.java
@@ -227,6 +227,7 @@ public class DeployState implements ConfigDefinitionStore {
private Zone zone = Zone.defaultZone();
private Instant now = Instant.now();
private Version wantedNodeVespaVersion = Vtag.currentVersion;
+ private boolean isFirstTimeDeployment = false;
public Builder applicationPackage(ApplicationPackage applicationPackage) {
this.applicationPackage = applicationPackage;