From f89d05edcbb45ac127254eb405c4dcde4bf56d91 Mon Sep 17 00:00:00 2001 From: Simon Ferquel Date: Thu, 28 Mar 2019 14:42:11 +0100 Subject: [PATCH] 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 --- cli/command/stack/kubernetes/watcher.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cli/command/stack/kubernetes/watcher.go b/cli/command/stack/kubernetes/watcher.go index 93d3358b4b..e42cf32586 100644 --- a/cli/command/stack/kubernetes/watcher.go +++ b/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) }, },