15003: Fix errant warnings on PostgreSQL params and InternalURLs.
authorTom Clegg <tclegg@veritasgenetics.com>
Wed, 10 Jul 2019 19:09:10 +0000 (15:09 -0400)
committerTom Clegg <tclegg@veritasgenetics.com>
Wed, 10 Jul 2019 19:09:10 +0000 (15:09 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg@veritasgenetics.com>

lib/config/cmd_test.go
lib/config/config.default.yml
lib/config/generated_config.go
lib/config/load.go

index f2915a03917260aa07fd5c656b5a1b9c7833757f..7fc1ef9772a4c94dc77a17d595fdb57866d9b8f4 100644 (file)
@@ -42,6 +42,13 @@ Clusters:
  z1234:
   API:
     MaxItemsPerResponse: 1234
+  PostgreSQL:
+    Connection:
+      sslmode: require
+  Services:
+    RailsAPI:
+      InternalURLs:
+        "http://0.0.0.0:8000": {}
 `
        code := CheckCommand.RunCommand("arvados config-check", []string{"-config", "-"}, bytes.NewBufferString(in), &stdout, &stderr)
        c.Check(code, check.Equals, 0)
index 87ca9d290d57dcd11ac91446e1f454f44ee07ddb..b97dbc8cf05c1bda71c3e56fa5789b8afe99dd21 100644 (file)
@@ -19,6 +19,16 @@ Clusters:
     ManagementToken: ""
 
     Services:
+
+      # In each of the service sections below, the keys under
+      # InternalURLs are the endpoints where the service should be
+      # listening, and reachable from other hosts in the cluster.
+      SAMPLE:
+        InternalURLs:
+          "http://example.host:12345": {}
+          SAMPLE: {}
+        ExternalURL: "-"
+
       RailsAPI:
         InternalURLs: {}
         ExternalURL: "-"
@@ -140,6 +150,7 @@ Clusters:
         user: ""
         password: ""
         dbname: ""
+        SAMPLE: ""
     API:
       # Maximum size (in bytes) allowed for a single API request.  This
       # limit is published in the discovery document for use by clients.
index 35443b2bd47c412e7f7e71a92ee1f029e401b991..bf0896ff8b1ce455d467ebd45810f9b60a905352 100644 (file)
@@ -25,6 +25,16 @@ Clusters:
     ManagementToken: ""
 
     Services:
+
+      # In each of the service sections below, the keys under
+      # InternalURLs are the endpoints where the service should be
+      # listening, and reachable from other hosts in the cluster.
+      SAMPLE:
+        InternalURLs:
+          "http://example.host:12345": {}
+          SAMPLE: {}
+        ExternalURL: "-"
+
       RailsAPI:
         InternalURLs: {}
         ExternalURL: "-"
@@ -146,6 +156,7 @@ Clusters:
         user: ""
         password: ""
         dbname: ""
+        SAMPLE: ""
     API:
       # Maximum size (in bytes) allowed for a single API request.  This
       # limit is published in the discovery document for use by clients.
index a0c769537487cce179ff74d65035144ef647b561..ee9cdd60f43e71cc70ec6b766ea2bb0a4c78b1dc 100644 (file)
@@ -156,8 +156,12 @@ func logExtraKeys(log logger, expected, supplied map[string]interface{}, prefix
                allowed[strings.ToLower(k)] = v
        }
        for k, vsupp := range supplied {
+               if k == "SAMPLE" {
+                       // entry will be dropped in removeSampleKeys anyway
+                       continue
+               }
                vexp, ok := allowed[strings.ToLower(k)]
-               if !ok && expected["SAMPLE"] != nil {
+               if expected["SAMPLE"] != nil {
                        vexp = expected["SAMPLE"]
                } else if !ok {
                        log.Warnf("deprecated or unknown config entry: %s%s", prefix, k)