diff options
author | Martin Polden <mpolden@mpolden.no> | 2018-10-29 14:14:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-29 14:14:54 +0100 |
commit | 00326a0327f802026f6737e31c0078842d976ffa (patch) | |
tree | 37a6de2b2857650fcc12d841723bff36b148c7c8 /node-repository | |
parent | 425ea5edda9d8406b84be84fd32b9d1ddb7f5622 (diff) | |
parent | 91cb85833ef8b1f56a316e9897a6541761308dd4 (diff) |
Merge pull request #7478 from vespa-engine/mpolden/controllerhost-orchestrator
Allow controller host to access orchestrator API
Diffstat (limited to 'node-repository')
2 files changed, 2 insertions, 9 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/v2/filter/Authorizer.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/v2/filter/Authorizer.java index ad078e09c45..95f69dc1c2a 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/v2/filter/Authorizer.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/v2/filter/Authorizer.java @@ -186,7 +186,7 @@ public class Authorizer implements BiPredicate<NodePrincipal, URI> { if (!isChildOf(root, path)) { return Optional.empty(); } - path = path.substring(root.length(), path.length()); + path = path.substring(root.length()); int firstSeparator = path.indexOf('/'); if (firstSeparator == -1) { return Optional.of(path); @@ -203,7 +203,7 @@ public class Authorizer implements BiPredicate<NodePrincipal, URI> { if (lastSeparator == -1) { return path; } - return path.substring(lastSeparator + 1, path.length()); + return path.substring(lastSeparator + 1); } } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTester.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTester.java index 1f26cf035b1..d5ef20a63df 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTester.java +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTester.java @@ -26,7 +26,6 @@ import com.yahoo.vespa.hosted.provision.Node; import com.yahoo.vespa.hosted.provision.NodeList; import com.yahoo.vespa.hosted.provision.NodeRepository; import com.yahoo.vespa.hosted.provision.node.Agent; -import com.yahoo.vespa.hosted.provision.node.Allocation; import com.yahoo.vespa.hosted.provision.node.filter.NodeHostFilter; import com.yahoo.vespa.hosted.provision.persistence.NameResolver; import com.yahoo.vespa.hosted.provision.testutils.MockNameResolver; @@ -370,12 +369,6 @@ public class ProvisioningTester { return nodeRepository.getNode(hostname).map(Node::flavor).orElseThrow(() -> new RuntimeException("No flavor for host " + hostname)); } - public static Set<HostSpec> toHostSpecs(List<Node> nodes) { - return nodes.stream() - .map(node -> new HostSpec(node.hostname(), node.allocation().map(Allocation::membership))) - .collect(Collectors.toSet()); - } - private static class NullProvisionLogger implements ProvisionLogger { @Override |