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) }, }, 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") }()