From c5c4d0abca292c930d2839291e4493754061db17 Mon Sep 17 00:00:00 2001 From: Adam Jordens Date: Sun, 19 Feb 2017 19:36:50 -0800 Subject: [PATCH] Introduce a new `namespace` attribute to `EntityTag` The idea being that tag name's could be re-used across namespaces, either intentionally or accidentally. Permissions / restrictions could also be applied to namespaces vs. individual tag names. Will need to sort out re-indexing and assign a proper namespace to all existing tags. Depends on spinnaker/front50#203 --- .../netflix/spinnaker/clouddriver/model/EntityTags.groovy | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/clouddriver-core/src/main/groovy/com/netflix/spinnaker/clouddriver/model/EntityTags.groovy b/clouddriver-core/src/main/groovy/com/netflix/spinnaker/clouddriver/model/EntityTags.groovy index 36b18e88671..9bf8d66a664 100644 --- a/clouddriver-core/src/main/groovy/com/netflix/spinnaker/clouddriver/model/EntityTags.groovy +++ b/clouddriver-core/src/main/groovy/com/netflix/spinnaker/clouddriver/model/EntityTags.groovy @@ -105,6 +105,7 @@ class EntityTags { static class EntityTag { String name + String namespace Object value EntityTagValueType valueType @@ -112,6 +113,10 @@ class EntityTags { return name.toLowerCase() } + String getNamespace() { + return (namespace ?: "default").toLowerCase() + } + @JsonIgnore Object getValueForWrite(ObjectMapper objectMapper) { switch (valueType) {