mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 01:14:22 +00:00
@@ -11,13 +11,13 @@ import (
|
|||||||
|
|
||||||
// Reproduce issue #3732
|
// Reproduce issue #3732
|
||||||
func TestValidatingWebhookCombinedNamespaces(t *testing.T) {
|
func TestValidatingWebhookCombinedNamespaces(t *testing.T) {
|
||||||
th := kusttest_test.MakeHarness(t)
|
th := kusttest_test.MakeHarness(t)
|
||||||
th.WriteK("base", `
|
th.WriteK("base", `
|
||||||
resources:
|
resources:
|
||||||
- service.yaml
|
- service.yaml
|
||||||
- validatingwebhook.yaml
|
- validatingwebhook.yaml
|
||||||
`)
|
`)
|
||||||
th.WriteF("base/service.yaml", `
|
th.WriteF("base/service.yaml", `
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
@@ -30,7 +30,7 @@ spec:
|
|||||||
port: 443
|
port: 443
|
||||||
targetPort: webhook
|
targetPort: webhook
|
||||||
`)
|
`)
|
||||||
th.WriteF("base/validatingwebhook.yaml", `
|
th.WriteF("base/validatingwebhook.yaml", `
|
||||||
apiVersion: admissionregistration.k8s.io/v1
|
apiVersion: admissionregistration.k8s.io/v1
|
||||||
kind: ValidatingWebhookConfiguration
|
kind: ValidatingWebhookConfiguration
|
||||||
metadata:
|
metadata:
|
||||||
@@ -59,14 +59,14 @@ webhooks:
|
|||||||
name: admission
|
name: admission
|
||||||
path: /networking/v1beta1/ingresses
|
path: /networking/v1beta1/ingresses
|
||||||
`)
|
`)
|
||||||
th.WriteK("overlay", `
|
th.WriteK("overlay", `
|
||||||
namespace: merge-namespace
|
namespace: merge-namespace
|
||||||
resources:
|
resources:
|
||||||
- ../base
|
- ../base
|
||||||
patchesStrategicMerge:
|
patchesStrategicMerge:
|
||||||
- validatingwebhookdelete.yaml
|
- validatingwebhookdelete.yaml
|
||||||
`)
|
`)
|
||||||
th.WriteF("overlay/validatingwebhookdelete.yaml", `
|
th.WriteF("overlay/validatingwebhookdelete.yaml", `
|
||||||
apiVersion: admissionregistration.k8s.io/v1
|
apiVersion: admissionregistration.k8s.io/v1
|
||||||
kind: ValidatingWebhookConfiguration
|
kind: ValidatingWebhookConfiguration
|
||||||
metadata:
|
metadata:
|
||||||
@@ -103,7 +103,7 @@ webhooks:
|
|||||||
clientConfig:
|
clientConfig:
|
||||||
service:
|
service:
|
||||||
name: admission
|
name: admission
|
||||||
namespace: base-namespace
|
namespace: merge-namespace
|
||||||
path: /networking/v1beta1/ingresses
|
path: /networking/v1beta1/ingresses
|
||||||
failurePolicy: Fail
|
failurePolicy: Fail
|
||||||
matchPolicy: Equivalent
|
matchPolicy: Equivalent
|
||||||
@@ -133,5 +133,3 @@ spec:
|
|||||||
type: ClusterIP
|
type: ClusterIP
|
||||||
`)
|
`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user