Backport: Fix exec parameter parsing (#580) (#604)

* Fix exec parameter parsing (#580)

Exec seems to be broken by ad6fbba806
This change basically copies what's in remotecommand.NewOptions, just
without the logging.

(cherry picked from commit 449eb3bb7d)

* Don't set cancel function to nil on error

Backported from ceb9b16c5c
This commit is contained in:
Brian Goff
2019-05-06 11:32:34 -07:00
committed by GitHub
parent 686cdb8b36
commit 7b92d1eee2
3 changed files with 33 additions and 23 deletions

View File

@@ -44,9 +44,9 @@ func loadTLSConfig(certPath, keyPath string) (*tls.Config, error) {
}, nil
}
func setupHTTPServer(ctx context.Context, cfg *apiServerConfig) (cancel func(), retErr error) {
func setupHTTPServer(ctx context.Context, cfg *apiServerConfig) (_ func(), retErr error) {
var closers []io.Closer
cancel = func() {
cancel := func() {
for _, c := range closers {
c.Close()
}