From 515ac23e13aa24daa7616185a12f0c82179e45a5 Mon Sep 17 00:00:00 2001 From: Simon Ferquel Date: Thu, 28 Mar 2019 14:42:11 +0100 Subject: [PATCH 1/2] Fix the stack informer's selector used to track deployment Old selector was wrong (it watched for the label we applied to child resources when reconciling the stack, instead of the stack itself) This should be back-ported to older version of the CLI Signed-off-by: Simon Ferquel (cherry picked from commit 8cd74eb33abc224e24d82146fc87d3392130a860) Signed-off-by: Sebastiaan van Stijn Upstream-commit: f89d05edcbb45ac127254eb405c4dcde4bf56d91 Component: cli --- components/cli/cli/command/stack/kubernetes/watcher.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/cli/cli/command/stack/kubernetes/watcher.go b/components/cli/cli/command/stack/kubernetes/watcher.go index 93d3358b4b..e42cf32586 100644 --- a/components/cli/cli/command/stack/kubernetes/watcher.go +++ b/components/cli/cli/command/stack/kubernetes/watcher.go @@ -10,6 +10,7 @@ import ( "github.com/pkg/errors" apiv1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/runtime" runtimeutil "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/watch" @@ -240,12 +241,12 @@ func newStackInformer(stacksClient stackListWatch, stackName string) cache.Share return cache.NewSharedInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { - options.LabelSelector = labels.SelectorForStack(stackName) + options.FieldSelector = fields.OneTermEqualSelector("metadata.name", stackName).String() return stacksClient.List(options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - options.LabelSelector = labels.SelectorForStack(stackName) + options.FieldSelector = fields.OneTermEqualSelector("metadata.name", stackName).String() return stacksClient.Watch(options) }, }, From 4f1c08734527d31efa6db9b6a3088bdde8309631 Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Fri, 22 Mar 2019 20:22:00 +0900 Subject: [PATCH 2/2] dial-stdio: fix goroutine leakage Fix #1736 Signed-off-by: Akihiro Suda (cherry picked from commit f8d4c443baedb7b19886593a4654f5c85fc33c43) Signed-off-by: Sebastiaan van Stijn Upstream-commit: d8c6c830f8414ae71d15212df2ea9b22190ce039 Component: cli --- components/cli/cli/command/system/dial_stdio.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/cli/cli/command/system/dial_stdio.go b/components/cli/cli/command/system/dial_stdio.go index 017ed40ce3..2385c14567 100644 --- a/components/cli/cli/command/system/dial_stdio.go +++ b/components/cli/cli/command/system/dial_stdio.go @@ -46,8 +46,8 @@ func runDialStdio(dockerCli command.Cli) error { return errors.New("the raw stream connection does not implement halfCloser") } - stdin2conn := make(chan error) - conn2stdout := make(chan error) + stdin2conn := make(chan error, 1) + conn2stdout := make(chan error, 1) go func() { stdin2conn <- copier(connHalfCloser, &halfReadCloserWrapper{os.Stdin}, "stdin to stream") }()