Skip to content

Commit 75f90f2

Browse files
authored
Merge pull request #8028 from vitanovs/chore/e2e-make-vpa-observer-reuse-test-framework-namespace
e2e(recommender): Restrict the internal `VPA` controller scope to test namespace
2 parents 25ad4c2 + c450973 commit 75f90f2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

vertical-pod-autoscaler/e2e/v1/recommender.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ func (o *observer) OnUpdate(oldObj, newObj interface{}) {
102102
go func() { o.channel <- result }()
103103
}
104104

105-
func getVpaObserver(vpaClientSet vpa_clientset.Interface) *observer {
106-
vpaListWatch := cache.NewListWatchFromClient(vpaClientSet.AutoscalingV1().RESTClient(), "verticalpodautoscalers", apiv1.NamespaceAll, fields.Everything())
105+
func getVpaObserver(vpaClientSet vpa_clientset.Interface, namespace string) *observer {
106+
vpaListWatch := cache.NewListWatchFromClient(vpaClientSet.AutoscalingV1().RESTClient(), "verticalpodautoscalers", namespace, fields.Everything())
107107
vpaObserver := observer{channel: make(chan recommendationChange)}
108108
_, controller := cache.NewIndexerInformer(vpaListWatch,
109109
&vpa_types.VerticalPodAutoscaler{},
@@ -232,7 +232,7 @@ var _ = RecommenderE2eDescribe("VPA CRD object", func() {
232232

233233
ginkgo.It("doesn't drop lower/upper after recommender's restart", func() {
234234

235-
o := getVpaObserver(vpaClientSet)
235+
o := getVpaObserver(vpaClientSet, f.Namespace.Name)
236236

237237
ginkgo.By("Waiting for recommendation to be filled")
238238
_, err := WaitForRecommendationPresent(vpaClientSet, vpaCRD)

0 commit comments

Comments
 (0)