aboutsummaryrefslogtreecommitdiffstats
path: root/flags
diff options
context:
space:
mode:
authorHåkon Hallingstad <hakon@yahooinc.com>2023-07-31 11:01:24 +0200
committerHåkon Hallingstad <hakon@yahooinc.com>2023-07-31 11:01:24 +0200
commit95ec5f8dc1480b1be93d16e01596d2f6b593a88d (patch)
tree0e7c242c1bb83375c11f90457d7f595f6ec52ebf /flags
parente32a2809bfc1a1302b2f66b5104d77f6d475c5dc (diff)
Add environment dimension
Diffstat (limited to 'flags')
-rw-r--r--flags/src/main/java/com/yahoo/vespa/flags/FetchVector.java3
-rw-r--r--flags/src/main/java/com/yahoo/vespa/flags/Flags.java6
-rw-r--r--flags/src/main/java/com/yahoo/vespa/flags/json/DimensionHelper.java1
3 files changed, 7 insertions, 3 deletions
diff --git a/flags/src/main/java/com/yahoo/vespa/flags/FetchVector.java b/flags/src/main/java/com/yahoo/vespa/flags/FetchVector.java
index 8dff69b5a60..5bcc1e67547 100644
--- a/flags/src/main/java/com/yahoo/vespa/flags/FetchVector.java
+++ b/flags/src/main/java/com/yahoo/vespa/flags/FetchVector.java
@@ -43,6 +43,9 @@ public class FetchVector {
/** Email address of user - provided by auth0 in console. */
CONSOLE_USER_EMAIL,
+ /** Hosted Vespa environment from com.yahoo.config.provision.Environment::value, e.g. prod, staging, test. */
+ ENVIRONMENT,
+
/**
* Fully qualified hostname.
*
diff --git a/flags/src/main/java/com/yahoo/vespa/flags/Flags.java b/flags/src/main/java/com/yahoo/vespa/flags/Flags.java
index 260499588ae..a87bfd97c27 100644
--- a/flags/src/main/java/com/yahoo/vespa/flags/Flags.java
+++ b/flags/src/main/java/com/yahoo/vespa/flags/Flags.java
@@ -538,9 +538,9 @@ public class Flags {
* For instance, if APPLICATION is one of the dimensions here, you should make sure
* APPLICATION is set to the ApplicationId in the fetch vector when fetching the RawFlag
* from the FlagSource.
- * SYSTEM, CLOUD, and ZONE_ID are special: These dimensions are resolved just before the
- * flag data is published to a zone. This means there is never any need to set these
- * dimensions when resolving a flag, and setting these dimensions just before resolving
+ * SYSTEM, CLOUD, ENVIRONMENT, and ZONE_ID are special: These dimensions are resolved just
+ * before the flag data is published to a zone. This means there is never any need to set
+ * these dimensions when resolving a flag, and setting these dimensions just before resolving
* the flag will have no effect.
* There is one exception. If any of these dimensions are declared when defining a flag,
* then those dimensions are NOT resolved when published to the controllers. This allows
diff --git a/flags/src/main/java/com/yahoo/vespa/flags/json/DimensionHelper.java b/flags/src/main/java/com/yahoo/vespa/flags/json/DimensionHelper.java
index 9516c12693d..5e5506b616b 100644
--- a/flags/src/main/java/com/yahoo/vespa/flags/json/DimensionHelper.java
+++ b/flags/src/main/java/com/yahoo/vespa/flags/json/DimensionHelper.java
@@ -20,6 +20,7 @@ public class DimensionHelper {
serializedDimensions.put(FetchVector.Dimension.CLUSTER_ID, "cluster-id");
serializedDimensions.put(FetchVector.Dimension.CLUSTER_TYPE, "cluster-type");
serializedDimensions.put(FetchVector.Dimension.CONSOLE_USER_EMAIL, "console-user-email");
+ serializedDimensions.put(FetchVector.Dimension.ENVIRONMENT, "environment");
serializedDimensions.put(FetchVector.Dimension.HOSTNAME, "hostname");
serializedDimensions.put(FetchVector.Dimension.NODE_TYPE, "node-type");
serializedDimensions.put(FetchVector.Dimension.SYSTEM, "system");