aboutsummaryrefslogtreecommitdiffstats
path: root/routing-generator
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2022-06-09 10:54:01 +0200
committerMartin Polden <mpolden@mpolden.no>2022-06-13 10:47:53 +0200
commitd2f5c29433bd1b1cdea67b78af7e3c59a5341c14 (patch)
treec73ab716802d0bd2d6cd5825931b47f0d8084e09 /routing-generator
parent49c0276d5286f469b02f774360fbe8d964cd7556 (diff)
Remove support for old health status format
Diffstat (limited to 'routing-generator')
-rw-r--r--routing-generator/src/main/java/com/yahoo/vespa/hosted/routing/nginx/NginxHealthClient.java7
-rw-r--r--routing-generator/src/test/resources/nginx-health-multiple-tenants-application-metrics.json3
-rw-r--r--routing-generator/src/test/resources/nginx-health-output-all-down.json3
-rw-r--r--routing-generator/src/test/resources/nginx-health-output-all-up-but-other-down.json3
-rw-r--r--routing-generator/src/test/resources/nginx-health-output-all-up.json3
-rw-r--r--routing-generator/src/test/resources/nginx-health-output-policy-down.json3
-rw-r--r--routing-generator/src/test/resources/nginx-health-output-policy-up.json3
-rw-r--r--routing-generator/src/test/resources/nginx-health-output.json3
8 files changed, 16 insertions, 12 deletions
diff --git a/routing-generator/src/main/java/com/yahoo/vespa/hosted/routing/nginx/NginxHealthClient.java b/routing-generator/src/main/java/com/yahoo/vespa/hosted/routing/nginx/NginxHealthClient.java
index fdfd0f71e96..c5634c396aa 100644
--- a/routing-generator/src/main/java/com/yahoo/vespa/hosted/routing/nginx/NginxHealthClient.java
+++ b/routing-generator/src/main/java/com/yahoo/vespa/hosted/routing/nginx/NginxHealthClient.java
@@ -82,12 +82,9 @@ public class NginxHealthClient extends AbstractComponent implements HealthStatus
Cursor root = slime.get();
List<ServerGroup.Server> servers = new ArrayList<>();
Cursor serversObject = root.field("servers");
+ Cursor serverArray = serversObject.field("stream");
- Cursor streamArray = serversObject.field("stream");
- Cursor serverArray = serversObject.field("server"); // TODO(mpolden): Remove after 2022-03-01
- Cursor array = streamArray.valid() ? streamArray : serverArray;
-
- array.traverse((ArrayTraverser) (idx, inspector) -> {
+ serverArray.traverse((ArrayTraverser) (idx, inspector) -> {
String upstreamName = inspector.field("upstream").asString();
String hostPort = inspector.field("name").asString();
boolean up = "up".equals(inspector.field("status").asString());
diff --git a/routing-generator/src/test/resources/nginx-health-multiple-tenants-application-metrics.json b/routing-generator/src/test/resources/nginx-health-multiple-tenants-application-metrics.json
index 4f537336849..38e01b23e79 100644
--- a/routing-generator/src/test/resources/nginx-health-multiple-tenants-application-metrics.json
+++ b/routing-generator/src/test/resources/nginx-health-multiple-tenants-application-metrics.json
@@ -2,7 +2,8 @@
{"servers": {
"total": 9,
"generation": 1,
- "server": [
+ "http": [],
+ "stream": [
{"index": 0, "upstream": "gateway.prod.music.vespa.us-east-2.prod", "name": "10.78.114.166:4080", "status": "up", "rise": 0, "fall": 1, "type": "http", "port": 0},
{"index": 1, "upstream": "gateway.prod.music.vespa.us-east-2.prod", "name": "10.78.115.68:4080", "status": "up", "rise": 2, "fall": 0, "type": "http", "port": 0},
{"index": 2, "upstream": "qrs.prod.music.vespa.us-east-2.prod", "name": "10.78.114.166:4080", "status": "up", "rise": 0, "fall": 1, "type": "http", "port": 0},
diff --git a/routing-generator/src/test/resources/nginx-health-output-all-down.json b/routing-generator/src/test/resources/nginx-health-output-all-down.json
index 634bcf33148..c79b977fa99 100644
--- a/routing-generator/src/test/resources/nginx-health-output-all-down.json
+++ b/routing-generator/src/test/resources/nginx-health-output-all-down.json
@@ -2,7 +2,8 @@
{"servers": {
"total": 4,
"generation": 1,
- "server": [
+ "http": [],
+ "stream": [
{"index": 0, "upstream": "gateway.prod.music.vespa.us-east-2.prod", "name": "10.78.114.166:4080", "status": "down", "rise": 0, "fall": 1, "type": "http", "port": 0},
{"index": 1, "upstream": "gateway.prod.music.vespa.us-east-2.prod", "name": "10.78.115.68:4080", "status": "down", "rise": 2, "fall": 0, "type": "http", "port": 0},
{"index": 2, "upstream": "gateway.prod.music.vespa.us-east-2.prod-feed", "name": "10.78.114.166:4080", "status": "down", "rise": 0, "fall": 1, "type": "http", "port": 0},
diff --git a/routing-generator/src/test/resources/nginx-health-output-all-up-but-other-down.json b/routing-generator/src/test/resources/nginx-health-output-all-up-but-other-down.json
index c8e15bffb25..085242d54d9 100644
--- a/routing-generator/src/test/resources/nginx-health-output-all-up-but-other-down.json
+++ b/routing-generator/src/test/resources/nginx-health-output-all-up-but-other-down.json
@@ -2,7 +2,8 @@
{"servers": {
"total": 2,
"generation": 1,
- "server": [
+ "http": [],
+ "stream": [
{"index": 0, "upstream": "gateway.prod.music.vespa.us-east-2.prod", "name": "10.78.114.166:4080", "status": "up", "rise": 0, "fall": 1, "type": "http", "port": 0},
{"index": 1, "upstream": "gateway.prod.music.vespa.us-east-2.prod", "name": "10.78.115.68:4080", "status": "up", "rise": 2, "fall": 0, "type": "http", "port": 0},
{"index": 0, "upstream": "frog.prod.music.vespa.us-east-2.prod", "name": "10.78.114.166:4080", "status": "down", "rise": 0, "fall": 1, "type": "http", "port": 0},
diff --git a/routing-generator/src/test/resources/nginx-health-output-all-up.json b/routing-generator/src/test/resources/nginx-health-output-all-up.json
index a7a635d9ae3..9032f013948 100644
--- a/routing-generator/src/test/resources/nginx-health-output-all-up.json
+++ b/routing-generator/src/test/resources/nginx-health-output-all-up.json
@@ -2,7 +2,8 @@
{"servers": {
"total": 2,
"generation": 1,
- "server": [
+ "http": [],
+ "stream": [
{"index": 0, "upstream": "gateway.prod.music.vespa.us-east-2.prod", "name": "10.78.114.166:4080", "status": "up", "rise": 0, "fall": 1, "type": "http", "port": 0},
{"index": 1, "upstream": "gateway.prod.music.vespa.us-east-2.prod", "name": "10.78.115.68:4080", "status": "up", "rise": 2, "fall": 0, "type": "http", "port": 0}
]
diff --git a/routing-generator/src/test/resources/nginx-health-output-policy-down.json b/routing-generator/src/test/resources/nginx-health-output-policy-down.json
index 347042b034a..e41b34855c0 100644
--- a/routing-generator/src/test/resources/nginx-health-output-policy-down.json
+++ b/routing-generator/src/test/resources/nginx-health-output-policy-down.json
@@ -2,7 +2,8 @@
{"servers": {
"total": 5,
"generation": 1,
- "server": [
+ "http": [],
+ "stream": [
{"index": 0, "upstream": "gateway.prod.music.vespa.us-east-2.prod", "name": "10.78.114.166:4080", "status": "up", "rise": 0, "fall": 1, "type": "http", "port": 0},
{"index": 1, "upstream": "gateway.prod.music.vespa.us-east-2.prod", "name": "10.78.115.68:4080", "status": "down", "rise": 2, "fall": 0, "type": "http", "port": 0},
{"index": 2, "upstream": "gateway.prod.music.vespa.us-east-2.prod", "name": "10.78.114.166:4080", "status": "down", "rise": 0, "fall": 1, "type": "http", "port": 0},
diff --git a/routing-generator/src/test/resources/nginx-health-output-policy-up.json b/routing-generator/src/test/resources/nginx-health-output-policy-up.json
index 7dd015a7667..a78185f0c07 100644
--- a/routing-generator/src/test/resources/nginx-health-output-policy-up.json
+++ b/routing-generator/src/test/resources/nginx-health-output-policy-up.json
@@ -2,7 +2,8 @@
{"servers": {
"total": 5,
"generation": 1,
- "server": [
+ "http": [],
+ "stream": [
{"index": 0, "upstream": "gateway.prod.music.vespa.us-east-2.prod", "name": "10.78.114.166:4080", "status": "up", "rise": 0, "fall": 1, "type": "http", "port": 0},
{"index": 1, "upstream": "gateway.prod.music.vespa.us-east-2.prod", "name": "10.78.115.68:4080", "status": "up", "rise": 2, "fall": 0, "type": "http", "port": 0},
{"index": 2, "upstream": "gateway.prod.music.vespa.us-east-2.prod", "name": "10.78.114.166:4080", "status": "down", "rise": 0, "fall": 1, "type": "http", "port": 0},
diff --git a/routing-generator/src/test/resources/nginx-health-output.json b/routing-generator/src/test/resources/nginx-health-output.json
index 9c27a906a68..9439e3f1ac4 100644
--- a/routing-generator/src/test/resources/nginx-health-output.json
+++ b/routing-generator/src/test/resources/nginx-health-output.json
@@ -2,7 +2,8 @@
{"servers": {
"total": 4,
"generation": 1,
- "server": [
+ "http": [],
+ "stream": [
{"index": 0, "upstream": "gateway.prod.music.vespa.us-east-2.prod", "name": "10.78.114.166:4080", "status": "down", "rise": 0, "fall": 1, "type": "http", "port": 0},
{"index": 1, "upstream": "gateway.prod.music.vespa.us-east-2.prod", "name": "10.78.115.68:4080", "status": "up", "rise": 2, "fall": 0, "type": "http", "port": 0},
{"index": 2, "upstream": "gateway.prod.music.vespa.us-east-2.prod-feed", "name": "10.78.114.166:4080", "status": "down", "rise": 0, "fall": 1, "type": "http", "port": 0},