diff options
author | Valerij Fredriksen <freva@users.noreply.github.com> | 2018-08-20 15:45:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-20 15:45:56 +0200 |
commit | 9c58236be4f3ef33dc57b5265b95c427dfa5fcf6 (patch) | |
tree | c9e3f7831051e7061011baf9a8592ca39aebb280 | |
parent | b871e16cdcf014ad519c0dbdbf00033c80860934 (diff) | |
parent | 2aaac12a16c0d33e4bbb0774e2851540fa6d7fb4 (diff) |
Merge pull request #6631 from vespa-engine/freva/set-correct-role
Set correct role in check config
2 files changed, 15 insertions, 1 deletions
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/maintenance/StorageMaintainer.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/maintenance/StorageMaintainer.java index 9a94946981f..1fe2719d2a0 100644 --- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/maintenance/StorageMaintainer.java +++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/maintenance/StorageMaintainer.java @@ -159,7 +159,7 @@ public class StorageMaintainer { private SecretAgentCheckConfig annotatedCheck(NodeSpec node, SecretAgentCheckConfig check) { check.withTag("namespace", "Vespa") - .withTag("role", "tenants") + .withTag("role", SecretAgentCheckConfig.nodeTypeToRole(node.getNodeType())) .withTag("flavor", node.getFlavor()) .withTag("canonicalFlavor", node.getCanonicalFlavor()) .withTag("state", node.getState().toString()) diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/util/SecretAgentCheckConfig.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/util/SecretAgentCheckConfig.java index 50e325c2149..09c6891612e 100644 --- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/util/SecretAgentCheckConfig.java +++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/util/SecretAgentCheckConfig.java @@ -1,6 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.hosted.node.admin.util; +import com.yahoo.config.provision.NodeType; import com.yahoo.vespa.hosted.node.admin.task.util.file.FileWriter; import java.io.IOException; @@ -74,4 +75,17 @@ public class SecretAgentCheckConfig { return stringBuilder.toString(); } + + // TODO: Change role dimension to nodeType? + public static String nodeTypeToRole(NodeType nodeType) { + switch (nodeType) { + case tenant: return "tenants"; + case host: return "docker"; + case proxy: return "routing"; + case proxyhost: return "routinghost"; + case config: return "configserver"; + case confighost: return "configserverhost"; + default: throw new IllegalArgumentException("Unknown node type " + nodeType); + } + } } |