Browse Source

Merge pull request #40045 from thaJeztah/bump_deps

Bump logrus 1.4.2, go-shellwords, mergo, flock, creack/pty, golang/gddo, gorilla/mux
Sebastiaan van Stijn 5 years ago
parent
commit
31da04af21

+ 7 - 7
vendor.conf

@@ -2,15 +2,15 @@ github.com/Azure/go-ansiterm                        d6e3b3328b783f23731bc4d05887
 github.com/Microsoft/hcsshim                        672e52e9209d1e53718c1b6a7d68cc9272654ab5
 github.com/Microsoft/hcsshim                        672e52e9209d1e53718c1b6a7d68cc9272654ab5
 github.com/Microsoft/go-winio                       6c72808b55902eae4c5943626030429ff20f3b63 # v0.4.14
 github.com/Microsoft/go-winio                       6c72808b55902eae4c5943626030429ff20f3b63 # v0.4.14
 github.com/docker/libtrust                          9cbd2a1374f46905c68a4eb3694a130610adc62a
 github.com/docker/libtrust                          9cbd2a1374f46905c68a4eb3694a130610adc62a
-github.com/golang/gddo                              9b12a26f3fbd7397dee4e20939ddca719d840d2a
+github.com/golang/gddo                              72a348e765d293ed6d1ded7b699591f14d6cd921
 github.com/google/uuid                              0cd6bf5da1e1c83f8b45653022c74f71af0538a4 # v1.1.1
 github.com/google/uuid                              0cd6bf5da1e1c83f8b45653022c74f71af0538a4 # v1.1.1
-github.com/gorilla/mux                              ed099d42384823742bba0bf9a72b53b55c9e2e38 # v1.7.2
+github.com/gorilla/mux                              00bdffe0f3c77e27d2cf6f5c70232a2d3e4d9c15 # v1.7.3
 github.com/Microsoft/opengcs                        a10967154e143a36014584a6f664344e3bb0aa64
 github.com/Microsoft/opengcs                        a10967154e143a36014584a6f664344e3bb0aa64
 
 
-github.com/creack/pty                               2769f65a3a94eb8f876f44a0459d24ae7ad2e488 # v1.1.7
+github.com/creack/pty                               3a6a957789163cacdfe0e291617a1c8e80612c11 # v1.1.9
 github.com/konsorten/go-windows-terminal-sequences  f55edac94c9bbba5d6182a4be46d86a2c9b5b50e # v1.0.2
 github.com/konsorten/go-windows-terminal-sequences  f55edac94c9bbba5d6182a4be46d86a2c9b5b50e # v1.0.2
-github.com/mattn/go-shellwords                      a72fbe27a1b0ed0df2f02754945044ce1456608b # v1.0.5
-github.com/sirupsen/logrus                          8bdbc7bcc01dcbb8ec23dc8a28e332258d25251f # v1.4.1
+github.com/mattn/go-shellwords                      36a9b3c57cb5caa559ff63fb7e9b585f1c00df75 # v1.0.6
+github.com/sirupsen/logrus                          839c75faf7f98a33d445d181f3018b5c3409a45e # v1.4.2
 github.com/tchap/go-patricia                        a7f0089c6f496e8e70402f61733606daa326cac5 # v2.3.0
 github.com/tchap/go-patricia                        a7f0089c6f496e8e70402f61733606daa326cac5 # v2.3.0
 golang.org/x/net                                    f3200d17e092c607f615320ecaad13d87ad9a2b3
 golang.org/x/net                                    f3200d17e092c607f615320ecaad13d87ad9a2b3
 golang.org/x/sys                                    9eafafc0a87e0fd0aeeba439a4573537970c44c7
 golang.org/x/sys                                    9eafafc0a87e0fd0aeeba439a4573537970c44c7
@@ -22,7 +22,7 @@ github.com/google/go-cmp                            3af367b6b30c263d47e8895973ed
 github.com/syndtr/gocapability                      d98352740cb2c55f81556b63d4a1ec64c5a319c2
 github.com/syndtr/gocapability                      d98352740cb2c55f81556b63d4a1ec64c5a319c2
 
 
 github.com/RackSec/srslog                           a4725f04ec91af1a91b380da679d6e0c2f061e59
 github.com/RackSec/srslog                           a4725f04ec91af1a91b380da679d6e0c2f061e59
-github.com/imdario/mergo                            7c29201646fa3de8506f701213473dd407f19646 # v0.3.7
+github.com/imdario/mergo                            1afb36080aec31e0d1528973ebe6721b191b0369 # v0.3.8
 golang.org/x/sync                                   e225da77a7e68af35c70ccbf71af2b83e6acac3c
 golang.org/x/sync                                   e225da77a7e68af35c70ccbf71af2b83e6acac3c
 
 
 # buildkit
 # buildkit
@@ -33,7 +33,7 @@ github.com/opentracing/opentracing-go               1361b9cd60be79c4c3a7fa9841b3
 github.com/google/shlex                             6f45313302b9c56850fc17f99e40caebce98c716
 github.com/google/shlex                             6f45313302b9c56850fc17f99e40caebce98c716
 github.com/opentracing-contrib/go-stdlib            b1a47cfbdd7543e70e9ef3e73d0802ad306cc1cc
 github.com/opentracing-contrib/go-stdlib            b1a47cfbdd7543e70e9ef3e73d0802ad306cc1cc
 github.com/mitchellh/hashstructure                  2bca23e0e452137f789efbc8610126fd8b94f73b
 github.com/mitchellh/hashstructure                  2bca23e0e452137f789efbc8610126fd8b94f73b
-github.com/gofrs/flock                              7f43ea2e6a643ad441fc12d0ecc0d3388b300c53 # v0.7.0
+github.com/gofrs/flock                              392e7fae8f1b0bdbd67dad7237d23f618feb6dbb # v0.7.1
 
 
 # libnetwork
 # libnetwork
 
 

+ 4 - 0
vendor/github.com/creack/pty/go.mod

@@ -0,0 +1,4 @@
+module github.com/creack/pty
+
+go 1.13
+

+ 1 - 0
vendor/github.com/gofrs/flock/README.md

@@ -2,6 +2,7 @@
 [![TravisCI Build Status](https://img.shields.io/travis/gofrs/flock/master.svg?style=flat)](https://travis-ci.org/gofrs/flock)
 [![TravisCI Build Status](https://img.shields.io/travis/gofrs/flock/master.svg?style=flat)](https://travis-ci.org/gofrs/flock)
 [![GoDoc](https://img.shields.io/badge/godoc-go--flock-blue.svg?style=flat)](https://godoc.org/github.com/gofrs/flock)
 [![GoDoc](https://img.shields.io/badge/godoc-go--flock-blue.svg?style=flat)](https://godoc.org/github.com/gofrs/flock)
 [![License](https://img.shields.io/badge/license-BSD_3--Clause-brightgreen.svg?style=flat)](https://github.com/gofrs/flock/blob/master/LICENSE)
 [![License](https://img.shields.io/badge/license-BSD_3--Clause-brightgreen.svg?style=flat)](https://github.com/gofrs/flock/blob/master/LICENSE)
+[![Go Report Card](https://goreportcard.com/badge/github.com/gofrs/flock)](https://goreportcard.com/report/github.com/gofrs/flock)
 
 
 `flock` implements a thread-safe sync.Locker interface for file locking. It also
 `flock` implements a thread-safe sync.Locker interface for file locking. It also
 includes a non-blocking TryLock() function to allow locking without blocking execution.
 includes a non-blocking TryLock() function to allow locking without blocking execution.

+ 5 - 5
vendor/github.com/gofrs/flock/flock.go

@@ -2,7 +2,7 @@
 // Use of this source code is governed by the BSD 3-Clause
 // Use of this source code is governed by the BSD 3-Clause
 // license that can be found in the LICENSE file.
 // license that can be found in the LICENSE file.
 
 
-// Package flock implements a thread-safe sync.Locker interface for file locking.
+// Package flock implements a thread-safe interface for file locking.
 // It also includes a non-blocking TryLock() function to allow locking
 // It also includes a non-blocking TryLock() function to allow locking
 // without blocking execution.
 // without blocking execution.
 //
 //
@@ -13,7 +13,7 @@
 // guaranteed to be the same on each platform. For example, some UNIX-like
 // guaranteed to be the same on each platform. For example, some UNIX-like
 // operating systems will transparently convert a shared lock to an exclusive
 // operating systems will transparently convert a shared lock to an exclusive
 // lock. If you Unlock() the flock from a location where you believe that you
 // lock. If you Unlock() the flock from a location where you believe that you
-// have the shared lock, you may accidently drop the exclusive lock.
+// have the shared lock, you may accidentally drop the exclusive lock.
 package flock
 package flock
 
 
 import (
 import (
@@ -86,17 +86,17 @@ func (f *Flock) String() string {
 // conditions is met: TryLock succeeds, TryLock fails with error, or Context
 // conditions is met: TryLock succeeds, TryLock fails with error, or Context
 // Done channel is closed.
 // Done channel is closed.
 func (f *Flock) TryLockContext(ctx context.Context, retryDelay time.Duration) (bool, error) {
 func (f *Flock) TryLockContext(ctx context.Context, retryDelay time.Duration) (bool, error) {
-	return tryCtx(f.TryLock, ctx, retryDelay)
+	return tryCtx(ctx, f.TryLock, retryDelay)
 }
 }
 
 
 // TryRLockContext repeatedly tries to take a shared lock until one of the
 // TryRLockContext repeatedly tries to take a shared lock until one of the
 // conditions is met: TryRLock succeeds, TryRLock fails with error, or Context
 // conditions is met: TryRLock succeeds, TryRLock fails with error, or Context
 // Done channel is closed.
 // Done channel is closed.
 func (f *Flock) TryRLockContext(ctx context.Context, retryDelay time.Duration) (bool, error) {
 func (f *Flock) TryRLockContext(ctx context.Context, retryDelay time.Duration) (bool, error) {
-	return tryCtx(f.TryRLock, ctx, retryDelay)
+	return tryCtx(ctx, f.TryRLock, retryDelay)
 }
 }
 
 
-func tryCtx(fn func() (bool, error), ctx context.Context, retryDelay time.Duration) (bool, error) {
+func tryCtx(ctx context.Context, fn func() (bool, error), retryDelay time.Duration) (bool, error) {
 	if ctx.Err() != nil {
 	if ctx.Err() != nil {
 		return false, ctx.Err()
 		return false, ctx.Err()
 	}
 	}

+ 2 - 4
vendor/github.com/golang/gddo/README.markdown

@@ -1,6 +1,6 @@
-This project is the source for http://godoc.org/
+This project is the source for https://godoc.org/
 
 
-[![GoDoc](https://godoc.org/github.com/golang/gddo?status.svg)](http://godoc.org/github.com/golang/gddo)
+[![GoDoc](https://godoc.org/github.com/golang/gddo?status.svg)](https://godoc.org/github.com/golang/gddo)
 [![Build
 [![Build
 Status](https://travis-ci.org/golang/gddo.svg?branch=master)](https://travis-ci.org/golang/gddo)
 Status](https://travis-ci.org/golang/gddo.svg?branch=master)](https://travis-ci.org/golang/gddo)
 
 
@@ -19,8 +19,6 @@ Contributions to this project are welcome, though please [file an
 issue](https://github.com/golang/gddo/issues/new). before starting work on
 issue](https://github.com/golang/gddo/issues/new). before starting work on
 anything major.
 anything major.
 
 
-**We do not accept GitHub pull requests**
-
 Please refer to the [Contribution
 Please refer to the [Contribution
 Guidelines](https://golang.org/doc/contribute.html) on how to submit changes.
 Guidelines](https://golang.org/doc/contribute.html) on how to submit changes.
 
 

+ 69 - 0
vendor/github.com/gorilla/mux/README.md

@@ -2,6 +2,7 @@
 
 
 [![GoDoc](https://godoc.org/github.com/gorilla/mux?status.svg)](https://godoc.org/github.com/gorilla/mux)
 [![GoDoc](https://godoc.org/github.com/gorilla/mux?status.svg)](https://godoc.org/github.com/gorilla/mux)
 [![Build Status](https://travis-ci.org/gorilla/mux.svg?branch=master)](https://travis-ci.org/gorilla/mux)
 [![Build Status](https://travis-ci.org/gorilla/mux.svg?branch=master)](https://travis-ci.org/gorilla/mux)
+[![CircleCI](https://circleci.com/gh/gorilla/mux.svg?style=svg)](https://circleci.com/gh/gorilla/mux)
 [![Sourcegraph](https://sourcegraph.com/github.com/gorilla/mux/-/badge.svg)](https://sourcegraph.com/github.com/gorilla/mux?badge)
 [![Sourcegraph](https://sourcegraph.com/github.com/gorilla/mux/-/badge.svg)](https://sourcegraph.com/github.com/gorilla/mux?badge)
 
 
 ![Gorilla Logo](http://www.gorillatoolkit.org/static/images/gorilla-icon-64.png)
 ![Gorilla Logo](http://www.gorillatoolkit.org/static/images/gorilla-icon-64.png)
@@ -29,6 +30,7 @@ The name mux stands for "HTTP request multiplexer". Like the standard `http.Serv
 * [Walking Routes](#walking-routes)
 * [Walking Routes](#walking-routes)
 * [Graceful Shutdown](#graceful-shutdown)
 * [Graceful Shutdown](#graceful-shutdown)
 * [Middleware](#middleware)
 * [Middleware](#middleware)
+* [Handling CORS Requests](#handling-cors-requests)
 * [Testing Handlers](#testing-handlers)
 * [Testing Handlers](#testing-handlers)
 * [Full Example](#full-example)
 * [Full Example](#full-example)
 
 
@@ -491,6 +493,73 @@ r.Use(amw.Middleware)
 
 
 Note: The handler chain will be stopped if your middleware doesn't call `next.ServeHTTP()` with the corresponding parameters. This can be used to abort a request if the middleware writer wants to. Middlewares _should_ write to `ResponseWriter` if they _are_ going to terminate the request, and they _should not_ write to `ResponseWriter` if they _are not_ going to terminate it.
 Note: The handler chain will be stopped if your middleware doesn't call `next.ServeHTTP()` with the corresponding parameters. This can be used to abort a request if the middleware writer wants to. Middlewares _should_ write to `ResponseWriter` if they _are_ going to terminate the request, and they _should not_ write to `ResponseWriter` if they _are not_ going to terminate it.
 
 
+### Handling CORS Requests
+
+[CORSMethodMiddleware](https://godoc.org/github.com/gorilla/mux#CORSMethodMiddleware) intends to make it easier to strictly set the `Access-Control-Allow-Methods` response header.
+
+* You will still need to use your own CORS handler to set the other CORS headers such as `Access-Control-Allow-Origin`
+* The middleware will set the `Access-Control-Allow-Methods` header to all the method matchers (e.g. `r.Methods(http.MethodGet, http.MethodPut, http.MethodOptions)` -> `Access-Control-Allow-Methods: GET,PUT,OPTIONS`) on a route
+* If you do not specify any methods, then:
+> _Important_: there must be an `OPTIONS` method matcher for the middleware to set the headers.
+
+Here is an example of using `CORSMethodMiddleware` along with a custom `OPTIONS` handler to set all the required CORS headers:
+
+```go
+package main
+
+import (
+	"net/http"
+	"github.com/gorilla/mux"
+)
+
+func main() {
+    r := mux.NewRouter()
+
+    // IMPORTANT: you must specify an OPTIONS method matcher for the middleware to set CORS headers
+    r.HandleFunc("/foo", fooHandler).Methods(http.MethodGet, http.MethodPut, http.MethodPatch, http.MethodOptions)
+    r.Use(mux.CORSMethodMiddleware(r))
+    
+    http.ListenAndServe(":8080", r)
+}
+
+func fooHandler(w http.ResponseWriter, r *http.Request) {
+    w.Header().Set("Access-Control-Allow-Origin", "*")
+    if r.Method == http.MethodOptions {
+        return
+    }
+
+    w.Write([]byte("foo"))
+}
+```
+
+And an request to `/foo` using something like:
+
+```bash
+curl localhost:8080/foo -v
+```
+
+Would look like:
+
+```bash
+*   Trying ::1...
+* TCP_NODELAY set
+* Connected to localhost (::1) port 8080 (#0)
+> GET /foo HTTP/1.1
+> Host: localhost:8080
+> User-Agent: curl/7.59.0
+> Accept: */*
+> 
+< HTTP/1.1 200 OK
+< Access-Control-Allow-Methods: GET,PUT,PATCH,OPTIONS
+< Access-Control-Allow-Origin: *
+< Date: Fri, 28 Jun 2019 20:13:30 GMT
+< Content-Length: 3
+< Content-Type: text/plain; charset=utf-8
+< 
+* Connection #0 to host localhost left intact
+foo
+```
+
 ### Testing Handlers
 ### Testing Handlers
 
 
 Testing handlers in a Go web application is straightforward, and _mux_ doesn't complicate this any further. Given two files: `endpoints.go` and `endpoints_test.go`, here's how we'd test an application using _mux_.
 Testing handlers in a Go web application is straightforward, and _mux_ doesn't complicate this any further. Given two files: `endpoints.go` and `endpoints_test.go`, here's how we'd test an application using _mux_.

+ 1 - 1
vendor/github.com/gorilla/mux/doc.go

@@ -295,7 +295,7 @@ A more complex authentication middleware, which maps session token to users, cou
 	r := mux.NewRouter()
 	r := mux.NewRouter()
 	r.HandleFunc("/", handler)
 	r.HandleFunc("/", handler)
 
 
-	amw := authenticationMiddleware{}
+	amw := authenticationMiddleware{tokenUsers: make(map[string]string)}
 	amw.Populate()
 	amw.Populate()
 
 
 	r.Use(amw.Middleware)
 	r.Use(amw.Middleware)

+ 34 - 27
vendor/github.com/gorilla/mux/middleware.go

@@ -32,37 +32,19 @@ func (r *Router) useInterface(mw middleware) {
 	r.middlewares = append(r.middlewares, mw)
 	r.middlewares = append(r.middlewares, mw)
 }
 }
 
 
-// CORSMethodMiddleware sets the Access-Control-Allow-Methods response header
-// on a request, by matching routes based only on paths. It also handles
-// OPTIONS requests, by settings Access-Control-Allow-Methods, and then
-// returning without calling the next http handler.
+// CORSMethodMiddleware automatically sets the Access-Control-Allow-Methods response header
+// on requests for routes that have an OPTIONS method matcher to all the method matchers on
+// the route. Routes that do not explicitly handle OPTIONS requests will not be processed
+// by the middleware. See examples for usage.
 func CORSMethodMiddleware(r *Router) MiddlewareFunc {
 func CORSMethodMiddleware(r *Router) MiddlewareFunc {
 	return func(next http.Handler) http.Handler {
 	return func(next http.Handler) http.Handler {
 		return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
 		return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
-			var allMethods []string
-
-			err := r.Walk(func(route *Route, _ *Router, _ []*Route) error {
-				for _, m := range route.matchers {
-					if _, ok := m.(*routeRegexp); ok {
-						if m.Match(req, &RouteMatch{}) {
-							methods, err := route.GetMethods()
-							if err != nil {
-								return err
-							}
-
-							allMethods = append(allMethods, methods...)
-						}
-						break
-					}
-				}
-				return nil
-			})
-
+			allMethods, err := getAllMethodsForRoute(r, req)
 			if err == nil {
 			if err == nil {
-				w.Header().Set("Access-Control-Allow-Methods", strings.Join(append(allMethods, "OPTIONS"), ","))
-
-				if req.Method == "OPTIONS" {
-					return
+				for _, v := range allMethods {
+					if v == http.MethodOptions {
+						w.Header().Set("Access-Control-Allow-Methods", strings.Join(allMethods, ","))
+					}
 				}
 				}
 			}
 			}
 
 
@@ -70,3 +52,28 @@ func CORSMethodMiddleware(r *Router) MiddlewareFunc {
 		})
 		})
 	}
 	}
 }
 }
+
+// getAllMethodsForRoute returns all the methods from method matchers matching a given
+// request.
+func getAllMethodsForRoute(r *Router, req *http.Request) ([]string, error) {
+	var allMethods []string
+
+	err := r.Walk(func(route *Route, _ *Router, _ []*Route) error {
+		for _, m := range route.matchers {
+			if _, ok := m.(*routeRegexp); ok {
+				if m.Match(req, &RouteMatch{}) {
+					methods, err := route.GetMethods()
+					if err != nil {
+						return err
+					}
+
+					allMethods = append(allMethods, methods...)
+				}
+				break
+			}
+		}
+		return nil
+	})
+
+	return allMethods, err
+}

+ 39 - 11
vendor/github.com/imdario/mergo/merge.go

@@ -26,10 +26,12 @@ func hasExportedField(dst reflect.Value) (exported bool) {
 }
 }
 
 
 type Config struct {
 type Config struct {
-	Overwrite               bool
-	AppendSlice             bool
-	Transformers            Transformers
-	overwriteWithEmptyValue bool
+	Overwrite                    bool
+	AppendSlice                  bool
+	TypeCheck                    bool
+	Transformers                 Transformers
+	overwriteWithEmptyValue      bool
+	overwriteSliceWithEmptyValue bool
 }
 }
 
 
 type Transformers interface {
 type Transformers interface {
@@ -41,7 +43,9 @@ type Transformers interface {
 // short circuiting on recursive types.
 // short circuiting on recursive types.
 func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, config *Config) (err error) {
 func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, config *Config) (err error) {
 	overwrite := config.Overwrite
 	overwrite := config.Overwrite
+	typeCheck := config.TypeCheck
 	overwriteWithEmptySrc := config.overwriteWithEmptyValue
 	overwriteWithEmptySrc := config.overwriteWithEmptyValue
+	overwriteSliceWithEmptySrc := config.overwriteSliceWithEmptyValue
 	config.overwriteWithEmptyValue = false
 	config.overwriteWithEmptyValue = false
 
 
 	if !src.IsValid() {
 	if !src.IsValid() {
@@ -128,11 +132,14 @@ func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, co
 						dstSlice = reflect.ValueOf(dstElement.Interface())
 						dstSlice = reflect.ValueOf(dstElement.Interface())
 					}
 					}
 
 
-					if (!isEmptyValue(src) || overwriteWithEmptySrc) && (overwrite || isEmptyValue(dst)) && !config.AppendSlice {
+					if (!isEmptyValue(src) || overwriteWithEmptySrc || overwriteSliceWithEmptySrc) && (overwrite || isEmptyValue(dst)) && !config.AppendSlice {
+						if typeCheck && srcSlice.Type() != dstSlice.Type() {
+							return fmt.Errorf("cannot override two slices with different type (%s, %s)", srcSlice.Type(), dstSlice.Type())
+						}
 						dstSlice = srcSlice
 						dstSlice = srcSlice
 					} else if config.AppendSlice {
 					} else if config.AppendSlice {
 						if srcSlice.Type() != dstSlice.Type() {
 						if srcSlice.Type() != dstSlice.Type() {
-							return fmt.Errorf("cannot append two slice with different type (%s, %s)", srcSlice.Type(), dstSlice.Type())
+							return fmt.Errorf("cannot append two slices with different type (%s, %s)", srcSlice.Type(), dstSlice.Type())
 						}
 						}
 						dstSlice = reflect.AppendSlice(dstSlice, srcSlice)
 						dstSlice = reflect.AppendSlice(dstSlice, srcSlice)
 					}
 					}
@@ -143,7 +150,7 @@ func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, co
 				continue
 				continue
 			}
 			}
 
 
-			if srcElement.IsValid() && (overwrite || (!dstElement.IsValid() || isEmptyValue(dstElement))) {
+			if srcElement.IsValid() && ((srcElement.Kind() != reflect.Ptr && overwrite) || !dstElement.IsValid() || isEmptyValue(dstElement)) {
 				if dst.IsNil() {
 				if dst.IsNil() {
 					dst.Set(reflect.MakeMap(dst.Type()))
 					dst.Set(reflect.MakeMap(dst.Type()))
 				}
 				}
@@ -154,7 +161,7 @@ func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, co
 		if !dst.CanSet() {
 		if !dst.CanSet() {
 			break
 			break
 		}
 		}
-		if (!isEmptyValue(src) || overwriteWithEmptySrc) && (overwrite || isEmptyValue(dst)) && !config.AppendSlice {
+		if (!isEmptyValue(src) || overwriteWithEmptySrc || overwriteSliceWithEmptySrc) && (overwrite || isEmptyValue(dst)) && !config.AppendSlice {
 			dst.Set(src)
 			dst.Set(src)
 		} else if config.AppendSlice {
 		} else if config.AppendSlice {
 			if src.Type() != dst.Type() {
 			if src.Type() != dst.Type() {
@@ -168,11 +175,21 @@ func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, co
 		if src.IsNil() {
 		if src.IsNil() {
 			break
 			break
 		}
 		}
-		if src.Kind() != reflect.Interface {
+
+		if dst.Kind() != reflect.Ptr && src.Type().AssignableTo(dst.Type()) {
 			if dst.IsNil() || overwrite {
 			if dst.IsNil() || overwrite {
 				if dst.CanSet() && (overwrite || isEmptyValue(dst)) {
 				if dst.CanSet() && (overwrite || isEmptyValue(dst)) {
 					dst.Set(src)
 					dst.Set(src)
 				}
 				}
+			}
+			break
+		}
+
+		if src.Kind() != reflect.Interface {
+			if dst.IsNil() || (src.Kind() != reflect.Ptr && overwrite) {
+				if dst.CanSet() && (overwrite || isEmptyValue(dst)) {
+					dst.Set(src)
+				}
 			} else if src.Kind() == reflect.Ptr {
 			} else if src.Kind() == reflect.Ptr {
 				if err = deepMerge(dst.Elem(), src.Elem(), visited, depth+1, config); err != nil {
 				if err = deepMerge(dst.Elem(), src.Elem(), visited, depth+1, config); err != nil {
 					return
 					return
@@ -198,6 +215,7 @@ func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, co
 			dst.Set(src)
 			dst.Set(src)
 		}
 		}
 	}
 	}
+
 	return
 	return
 }
 }
 
 
@@ -209,7 +227,7 @@ func Merge(dst, src interface{}, opts ...func(*Config)) error {
 	return merge(dst, src, opts...)
 	return merge(dst, src, opts...)
 }
 }
 
 
-// MergeWithOverwrite will do the same as Merge except that non-empty dst attributes will be overriden by
+// MergeWithOverwrite will do the same as Merge except that non-empty dst attributes will be overridden by
 // non-empty src attribute values.
 // non-empty src attribute values.
 // Deprecated: use Merge(…) with WithOverride
 // Deprecated: use Merge(…) with WithOverride
 func MergeWithOverwrite(dst, src interface{}, opts ...func(*Config)) error {
 func MergeWithOverwrite(dst, src interface{}, opts ...func(*Config)) error {
@@ -228,11 +246,21 @@ func WithOverride(config *Config) {
 	config.Overwrite = true
 	config.Overwrite = true
 }
 }
 
 
-// WithAppendSlice will make merge append slices instead of overwriting it
+// WithOverride will make merge override empty dst slice with empty src slice.
+func WithOverrideEmptySlice(config *Config) {
+	config.overwriteSliceWithEmptyValue = true
+}
+
+// WithAppendSlice will make merge append slices instead of overwriting it.
 func WithAppendSlice(config *Config) {
 func WithAppendSlice(config *Config) {
 	config.AppendSlice = true
 	config.AppendSlice = true
 }
 }
 
 
+// WithTypeCheck will make merge check types while overwriting it (must be used with WithOverride).
+func WithTypeCheck(config *Config) {
+	config.TypeCheck = true
+}
+
 func merge(dst, src interface{}, opts ...func(*Config)) error {
 func merge(dst, src interface{}, opts ...func(*Config)) error {
 	var (
 	var (
 		vDst, vSrc reflect.Value
 		vDst, vSrc reflect.Value

+ 1 - 1
vendor/github.com/mattn/go-shellwords/README.md

@@ -1,6 +1,6 @@
 # go-shellwords
 # go-shellwords
 
 
-[![Coverage Status](https://coveralls.io/repos/mattn/go-shellwords/badge.png?branch=master)](https://coveralls.io/r/mattn/go-shellwords?branch=master)
+[![codecov](https://codecov.io/gh/mattn/go-shellwords/branch/master/graph/badge.svg)](https://codecov.io/gh/mattn/go-shellwords)
 [![Build Status](https://travis-ci.org/mattn/go-shellwords.svg?branch=master)](https://travis-ci.org/mattn/go-shellwords)
 [![Build Status](https://travis-ci.org/mattn/go-shellwords.svg?branch=master)](https://travis-ci.org/mattn/go-shellwords)
 
 
 Parse line as shell words.
 Parse line as shell words.

+ 7 - 9
vendor/github.com/mattn/go-shellwords/shellwords.go

@@ -40,6 +40,7 @@ type Parser struct {
 	ParseEnv      bool
 	ParseEnv      bool
 	ParseBacktick bool
 	ParseBacktick bool
 	Position      int
 	Position      int
+	Dir           string
 
 
 	// If ParseEnv is true, use this for getenv.
 	// If ParseEnv is true, use this for getenv.
 	// If nil, use os.Getenv.
 	// If nil, use os.Getenv.
@@ -51,6 +52,7 @@ func NewParser() *Parser {
 		ParseEnv:      ParseEnv,
 		ParseEnv:      ParseEnv,
 		ParseBacktick: ParseBacktick,
 		ParseBacktick: ParseBacktick,
 		Position:      0,
 		Position:      0,
+		Dir:           "",
 	}
 	}
 }
 }
 
 
@@ -100,11 +102,11 @@ loop:
 			if !singleQuoted && !doubleQuoted && !dollarQuote {
 			if !singleQuoted && !doubleQuoted && !dollarQuote {
 				if p.ParseBacktick {
 				if p.ParseBacktick {
 					if backQuote {
 					if backQuote {
-						out, err := shellRun(backtick)
+						out, err := shellRun(backtick, p.Dir)
 						if err != nil {
 						if err != nil {
 							return nil, err
 							return nil, err
 						}
 						}
-						buf = out
+						buf = buf[:len(buf)-len(backtick)] + out
 					}
 					}
 					backtick = ""
 					backtick = ""
 					backQuote = !backQuote
 					backQuote = !backQuote
@@ -117,15 +119,11 @@ loop:
 			if !singleQuoted && !doubleQuoted && !backQuote {
 			if !singleQuoted && !doubleQuoted && !backQuote {
 				if p.ParseBacktick {
 				if p.ParseBacktick {
 					if dollarQuote {
 					if dollarQuote {
-						out, err := shellRun(backtick)
+						out, err := shellRun(backtick, p.Dir)
 						if err != nil {
 						if err != nil {
 							return nil, err
 							return nil, err
 						}
 						}
-						if r == ')' {
-							buf = buf[:len(buf)-len(backtick)-2] + out
-						} else {
-							buf = buf[:len(buf)-len(backtick)-1] + out
-						}
+						buf = buf[:len(buf)-len(backtick)-2] + out
 					}
 					}
 					backtick = ""
 					backtick = ""
 					dollarQuote = !dollarQuote
 					dollarQuote = !dollarQuote
@@ -155,7 +153,7 @@ loop:
 				continue
 				continue
 			}
 			}
 		case ';', '&', '|', '<', '>':
 		case ';', '&', '|', '<', '>':
-			if !(escaped || singleQuoted || doubleQuoted || backQuote) {
+			if !(escaped || singleQuoted || doubleQuoted || backQuote || dollarQuote) {
 				if r == '>' && len(buf) > 0 {
 				if r == '>' && len(buf) > 0 {
 					if c := buf[0]; '0' <= c && c <= '9' {
 					if c := buf[0]; '0' <= c && c <= '9' {
 						i -= 1
 						i -= 1

+ 8 - 3
vendor/github.com/mattn/go-shellwords/util_go15.go

@@ -9,14 +9,19 @@ import (
 	"strings"
 	"strings"
 )
 )
 
 
-func shellRun(line string) (string, error) {
+func shellRun(line, dir string) (string, error) {
 	var b []byte
 	var b []byte
 	var err error
 	var err error
+	var cmd *exec.Cmd
 	if runtime.GOOS == "windows" {
 	if runtime.GOOS == "windows" {
-		b, err = exec.Command(os.Getenv("COMSPEC"), "/c", line).Output()
+		cmd = exec.Command(os.Getenv("COMSPEC"), "/c", line)
 	} else {
 	} else {
-		b, err = exec.Command(os.Getenv("SHELL"), "-c", line).Output()
+		cmd = exec.Command(os.Getenv("SHELL"), "-c", line)
 	}
 	}
+	if dir != "" {
+		cmd.Dir = dir
+	}
+	b, err = cmd.Output()
 	if err != nil {
 	if err != nil {
 		return "", err
 		return "", err
 	}
 	}

+ 6 - 2
vendor/github.com/mattn/go-shellwords/util_posix.go

@@ -9,9 +9,13 @@ import (
 	"strings"
 	"strings"
 )
 )
 
 
-func shellRun(line string) (string, error) {
+func shellRun(line, dir string) (string, error) {
 	shell := os.Getenv("SHELL")
 	shell := os.Getenv("SHELL")
-	b, err := exec.Command(shell, "-c", line).Output()
+	cmd := exec.Command(shell, "-c", line)
+	if dir != "" {
+		cmd.Dir = dir
+	}
+	b, err := cmd.Output()
 	if err != nil {
 	if err != nil {
 		if eerr, ok := err.(*exec.ExitError); ok {
 		if eerr, ok := err.(*exec.ExitError); ok {
 			b = eerr.Stderr
 			b = eerr.Stderr

+ 6 - 2
vendor/github.com/mattn/go-shellwords/util_windows.go

@@ -9,9 +9,13 @@ import (
 	"strings"
 	"strings"
 )
 )
 
 
-func shellRun(line string) (string, error) {
+func shellRun(line, dir string) (string, error) {
 	shell := os.Getenv("COMSPEC")
 	shell := os.Getenv("COMSPEC")
-	b, err := exec.Command(shell, "/c", line).Output()
+	cmd := exec.Command(shell, "/c", line)
+	if dir != "" {
+		cmd.Dir = dir
+	}
+	b, err := cmd.Output()
 	if err != nil {
 	if err != nil {
 		if eerr, ok := err.(*exec.ExitError); ok {
 		if eerr, ok := err.(*exec.ExitError); ok {
 			b = eerr.Stderr
 			b = eerr.Stderr

+ 1 - 1
vendor/github.com/sirupsen/logrus/go.mod

@@ -6,5 +6,5 @@ require (
 	github.com/pmezard/go-difflib v1.0.0 // indirect
 	github.com/pmezard/go-difflib v1.0.0 // indirect
 	github.com/stretchr/objx v0.1.1 // indirect
 	github.com/stretchr/objx v0.1.1 // indirect
 	github.com/stretchr/testify v1.2.2
 	github.com/stretchr/testify v1.2.2
-	golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33
+	golang.org/x/sys v0.0.0-20190422165155-953cdadca894
 )
 )

+ 1 - 1
vendor/github.com/sirupsen/logrus/terminal_check_js.go → vendor/github.com/sirupsen/logrus/terminal_check_no_terminal.go

@@ -1,4 +1,4 @@
-// +build js
+// +build js nacl plan9
 
 
 package logrus
 package logrus
 
 

+ 1 - 1
vendor/github.com/sirupsen/logrus/terminal_check_notappengine.go

@@ -1,4 +1,4 @@
-// +build !appengine,!js,!windows
+// +build !appengine,!js,!windows,!nacl,!plan9
 
 
 package logrus
 package logrus
 
 

+ 11 - 0
vendor/github.com/sirupsen/logrus/terminal_check_solaris.go

@@ -0,0 +1,11 @@
+package logrus
+
+import (
+	"golang.org/x/sys/unix"
+)
+
+// IsTerminal returns true if the given file descriptor is a terminal.
+func isTerminal(fd int) bool {
+	_, err := unix.IoctlGetTermio(fd, unix.TCGETA)
+	return err == nil
+}

+ 16 - 2
vendor/github.com/sirupsen/logrus/terminal_check_windows.go

@@ -6,15 +6,29 @@ import (
 	"io"
 	"io"
 	"os"
 	"os"
 	"syscall"
 	"syscall"
+
+	sequences "github.com/konsorten/go-windows-terminal-sequences"
 )
 )
 
 
+func initTerminal(w io.Writer) {
+	switch v := w.(type) {
+	case *os.File:
+		sequences.EnableVirtualTerminalProcessing(syscall.Handle(v.Fd()), true)
+	}
+}
+
 func checkIfTerminal(w io.Writer) bool {
 func checkIfTerminal(w io.Writer) bool {
+	var ret bool
 	switch v := w.(type) {
 	switch v := w.(type) {
 	case *os.File:
 	case *os.File:
 		var mode uint32
 		var mode uint32
 		err := syscall.GetConsoleMode(syscall.Handle(v.Fd()), &mode)
 		err := syscall.GetConsoleMode(syscall.Handle(v.Fd()), &mode)
-		return err == nil
+		ret = (err == nil)
 	default:
 	default:
-		return false
+		ret = false
+	}
+	if ret {
+		initTerminal(w)
 	}
 	}
+	return ret
 }
 }

+ 0 - 8
vendor/github.com/sirupsen/logrus/terminal_notwindows.go

@@ -1,8 +0,0 @@
-// +build !windows
-
-package logrus
-
-import "io"
-
-func initTerminal(w io.Writer) {
-}

+ 0 - 18
vendor/github.com/sirupsen/logrus/terminal_windows.go

@@ -1,18 +0,0 @@
-// +build !appengine,!js,windows
-
-package logrus
-
-import (
-	"io"
-	"os"
-	"syscall"
-
-	sequences "github.com/konsorten/go-windows-terminal-sequences"
-)
-
-func initTerminal(w io.Writer) {
-	switch v := w.(type) {
-	case *os.File:
-		sequences.EnableVirtualTerminalProcessing(syscall.Handle(v.Fd()), true)
-	}
-}

+ 0 - 4
vendor/github.com/sirupsen/logrus/text_formatter.go

@@ -84,10 +84,6 @@ type TextFormatter struct {
 func (f *TextFormatter) init(entry *Entry) {
 func (f *TextFormatter) init(entry *Entry) {
 	if entry.Logger != nil {
 	if entry.Logger != nil {
 		f.isTerminal = checkIfTerminal(entry.Logger.Out)
 		f.isTerminal = checkIfTerminal(entry.Logger.Out)
-
-		if f.isTerminal {
-			initTerminal(entry.Logger.Out)
-		}
 	}
 	}
 }
 }