Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Commit e2f1ea4

Browse files
author
Lukas Knuth
committed
Watch pods in specific namespace only.
This allows tighter permissions inside the cluster.
1 parent 007cc58 commit e2f1ea4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

k8s/watch.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ func AwaitTermination(pods []corev1.Pod, options *RequestOptions, timeout time.D
5959
}
6060

6161
func makeInformer(options *RequestOptions) cache.SharedIndexInformer {
62-
factory := informers.NewSharedInformerFactory(options.Clientset, time.Second)
62+
opts := informers.WithNamespace(options.Namespace)
63+
factory := informers.NewSharedInformerFactoryWithOptions(options.Clientset, time.Second, opts)
6364
return factory.Core().V1().Pods().Informer()
6465
}
6566

0 commit comments

Comments
 (0)