1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-10 09:56:55 +00:00
kyverno/test/e2e/mutate/config.go
shuting adcb89a1b5
Update to use gvk to store OpenAPI schema (#1906)
* bump swagger doc to 1.21.0

Signed-off-by: Shuting Zhao <shutting06@gmail.com>

* stores openapi schema by gvk

Signed-off-by: Shuting Zhao <shutting06@gmail.com>

* fix schema validation in CLI

Signed-off-by: Shuting Zhao <shutting06@gmail.com>

* add missing resource lists

Signed-off-by: Shuting Zhao <shutting06@gmail.com>

* add e2e tests

Signed-off-by: Shuting Zhao <shutting06@gmail.com>

* address review doc comments

Signed-off-by: Shuting Zhao <shutting06@gmail.com>
2021-05-13 12:03:13 -07:00

66 lines
1.7 KiB
Go

package mutate
// MutateTests is E2E Test Config for mutation
var MutateTests = []struct {
//TestName - Name of the Test
TestName string
// Data - The Yaml file of the ClusterPolicy
Data []byte
}{
{
TestName: "test-mutate-with-context",
Data: configMapMutationYaml,
},
{
TestName: "test-mutate-with-logic-in-context",
Data: configMapMutationWithContextLogicYaml,
},
{
TestName: "test-mutate-with-context-label-selection",
Data: configMapMutationWithContextLabelSelectionYaml,
},
}
var ingressTests = struct {
testNamesapce string
cpol []byte
tests []struct {
testName string
group, version, rsc, resourceName string
resource []byte
}
}{
testNamesapce: "test-ingress",
cpol: mutateIngressCpol,
tests: []struct {
testName string
group, version, rsc, resourceName string
resource []byte
}{
{
testName: "test-networking-v1-ingress",
group: "networking.k8s.io",
version: "v1",
rsc: "ingresses",
resourceName: "kuard-v1",
resource: ingressNetworkingV1,
},
// the following two tests can be removed after 1.22 cluster
{
testName: "test-networking-v1beta1-ingress",
group: "networking.k8s.io",
version: "v1beta1",
rsc: "ingresses",
resourceName: "kuard-v1beta1",
resource: ingressNetworkingV1beta1,
},
{
testName: "test-extensions-v1beta1-ingress",
group: "extensions",
version: "v1beta1",
rsc: "ingresses",
resourceName: "kuard-extensions",
resource: ingressExtensionV1beta1,
},
},
}