Skip to content

Commit 6be1549

Browse files
committed
VPA: (squash) Fix config test for in-place
The webhook registration check in the config test was expecting the webhook to only be watching for CREATE, but with in-place we're also registering to watch UPDATE so this test needs to take that into account
1 parent 36157d8 commit 6be1549

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

vertical-pod-autoscaler/pkg/admission-controller/config_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ func TestSelfRegistrationBase(t *testing.T) {
5353
assert.Equal(t, "vpa.k8s.io", webhook.Name, "expected webhook name to match")
5454

5555
PodRule := webhook.Rules[0]
56-
assert.Equal(t, []admissionregistration.OperationType{admissionregistration.Create}, PodRule.Operations, "expected operations to match")
56+
// we're watching for updates now also because of in-place VPA
57+
assert.Equal(t, []admissionregistration.OperationType{admissionregistration.Create, admissionregistration.Update}, PodRule.Operations, "expected operations to match")
5758
assert.Equal(t, []string{""}, PodRule.APIGroups, "expected API groups to match")
5859
assert.Equal(t, []string{"v1"}, PodRule.APIVersions, "expected API versions to match")
5960
assert.Equal(t, []string{"pods"}, PodRule.Resources, "expected resources to match")

0 commit comments

Comments
 (0)