15003: Fix errant warnings on PostgreSQL params and InternalURLs.
[arvados.git] / lib / config / load.go
index 3ed2b9928f6ef734cf9f739250e0d891d1664727..ee9cdd60f43e71cc70ec6b766ea2bb0a4c78b1dc 100644 (file)
@@ -23,6 +23,14 @@ type logger interface {
        Warnf(string, ...interface{})
 }
 
+func loadFileOrStdin(path string, stdin io.Reader, log logger) (*arvados.Config, error) {
+       if path == "-" {
+               return load(stdin, log, true)
+       } else {
+               return LoadFile(path, log)
+       }
+}
+
 func LoadFile(path string, log logger) (*arvados.Config, error) {
        f, err := os.Open(path)
        if err != nil {
@@ -148,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)