From: Tom Clegg Date: Wed, 10 Jul 2019 19:09:10 +0000 (-0400) Subject: 15003: Fix errant warnings on PostgreSQL params and InternalURLs. X-Git-Tag: 2.0.0~262^2~1 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/54d059bfc6d84dbc20613ddd17d812d571e93eda?hp=5f943cd451acfbdcddd84e791738c3aa5926bfed 15003: Fix errant warnings on PostgreSQL params and InternalURLs. Arvados-DCO-1.1-Signed-off-by: Tom Clegg --- diff --git a/lib/config/cmd_test.go b/lib/config/cmd_test.go index f2915a0391..7fc1ef9772 100644 --- a/lib/config/cmd_test.go +++ b/lib/config/cmd_test.go @@ -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) diff --git a/lib/config/config.default.yml b/lib/config/config.default.yml index 87ca9d290d..b97dbc8cf0 100644 --- a/lib/config/config.default.yml +++ b/lib/config/config.default.yml @@ -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. diff --git a/lib/config/generated_config.go b/lib/config/generated_config.go index 35443b2bd4..bf0896ff8b 100644 --- a/lib/config/generated_config.go +++ b/lib/config/generated_config.go @@ -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. diff --git a/lib/config/load.go b/lib/config/load.go index a0c7695374..ee9cdd60f4 100644 --- a/lib/config/load.go +++ b/lib/config/load.go @@ -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)