VMI label creation tests adopted to new label restriction policy.
@@ -361,43 +361,28 @@ var _ = Describe("Validating VMICreate Admitter", func() {
Expect(resp.Result.Details.Causes[0].Message).To(Equal("creation of kubevirt.io/ labels on a VMI object is restricted"))
}
},
- table.Entry("Create by API",
- map[string]string{"kubevirt.io/l": "someValue"},
+ table.Entry("Create restricted label by API",
+ map[string]string{v1.NodeNameLabel: "someValue"},
rbac.ApiServiceAccountName,
true,
),
- table.Entry("Create by Handler",
- map[string]string{"kubevirt.io/l": "someValue"},
+ table.Entry("Create restricted label by Handler",
+ map[string]string{v1.NodeNameLabel: "someValue"},
rbac.HandlerServiceAccountName,
true,
),
- table.Entry("Create by Controller",
- map[string]string{"kubevirt.io/l": "someValue"},
+ table.Entry("Create restricted label by Controller",
+ map[string]string{v1.NodeNameLabel: "someValue"},
rbac.ControllerServiceAccountName,
true,
),
- table.Entry("Create by non kubevirt user",
- map[string]string{"kubevirt.io/l": "someValue"},
+ table.Entry("Create restricted label by non kubevirt user",
+ map[string]string{v1.NodeNameLabel: "someValue"},
"user-account",
false,
),
- table.Entry("Create non kubevirt.io prefixed label by non kubevirt user",
- map[string]string{"someValue": "kubevirt.io/l"},
- "user-account",
- true,
- ),
- table.Entry("Create kubevirt.io OS label by non kubevirt user",
- map[string]string{"kubevirt.io/os": "linux"},
- "user-account",
- true,
- ),
- table.Entry("Create kubevirt.io VM label by non kubevirt user",
- map[string]string{"kubevirt.io/vm": "rhel"},
- "user-account",
- true,
- ),
- table.Entry("Create kubevirt.io flavor label by non kubevirt user",
- map[string]string{"kubevirt.io/flavor": "small"},
+ table.Entry("Create non restricted kubevirt.io prefixed label by non kubevirt user",
+ map[string]string{"kubevirt.io/l": "someValue"},
"user-account",
true,
),
