diff --git a/vertical-pod-autoscaler/pkg/admission-controller/resource/pod/recommendation/recommendation_provider_test.go b/vertical-pod-autoscaler/pkg/admission-controller/resource/pod/recommendation/recommendation_provider_test.go index f58e98f1a88e..36e64fad9924 100644 --- a/vertical-pod-autoscaler/pkg/admission-controller/resource/pod/recommendation/recommendation_provider_test.go +++ b/vertical-pod-autoscaler/pkg/admission-controller/resource/pod/recommendation/recommendation_provider_test.go @@ -311,8 +311,7 @@ func TestUpdateResourceRequests(t *testing.T) { return } - _, foundEmpty := resources[0].Requests[""] - assert.Equal(t, foundEmpty, false, "empty resourceKey have not been purged") + assert.Contains(t, resources, "", "expected empty resource to be removed") cpuRequest := resources[0].Requests[apiv1.ResourceCPU] assert.Equal(t, tc.expectedCPU.Value(), cpuRequest.Value(), "cpu request doesn't match")