mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 01:14:22 +00:00
Merge pull request #3356 from JaredTan95/update_extension_version
upgrade admissionregistration.k8s.io/v1beta1 version to v1
This commit is contained in:
@@ -21,7 +21,7 @@ func TestImageTagUpdater_Filter(t *testing.T) {
|
|||||||
}{
|
}{
|
||||||
"ignore CustomResourceDefinition": {
|
"ignore CustomResourceDefinition": {
|
||||||
input: `
|
input: `
|
||||||
apiVersion: apiextensions.k8s.io/v1beta1
|
apiVersion: apiextensions.k8s.io/v1
|
||||||
kind: CustomResourceDefinition
|
kind: CustomResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
name: whatever
|
name: whatever
|
||||||
@@ -30,7 +30,7 @@ spec:
|
|||||||
- image: whatever
|
- image: whatever
|
||||||
`,
|
`,
|
||||||
expectedOutput: `
|
expectedOutput: `
|
||||||
apiVersion: apiextensions.k8s.io/v1beta1
|
apiVersion: apiextensions.k8s.io/v1
|
||||||
kind: CustomResourceDefinition
|
kind: CustomResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
name: whatever
|
name: whatever
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ spec:
|
|||||||
action: fly
|
action: fly
|
||||||
`)
|
`)
|
||||||
th.WriteF("/app/base/mykind.yaml", `
|
th.WriteF("/app/base/mykind.yaml", `
|
||||||
apiVersion: jingfang.example.com/v1beta1
|
apiVersion: jingfang.example.com/v1
|
||||||
kind: MyKind
|
kind: MyKind
|
||||||
metadata:
|
metadata:
|
||||||
name: mykind
|
name: mykind
|
||||||
@@ -236,7 +236,7 @@ kind: Secret
|
|||||||
metadata:
|
metadata:
|
||||||
name: x-crdsecret
|
name: x-crdsecret
|
||||||
---
|
---
|
||||||
apiVersion: jingfang.example.com/v1beta1
|
apiVersion: jingfang.example.com/v1
|
||||||
kind: MyKind
|
kind: MyKind
|
||||||
metadata:
|
metadata:
|
||||||
name: x-mykind
|
name: x-mykind
|
||||||
@@ -285,7 +285,7 @@ kind: Secret
|
|||||||
metadata:
|
metadata:
|
||||||
name: prod-x-crdsecret
|
name: prod-x-crdsecret
|
||||||
---
|
---
|
||||||
apiVersion: jingfang.example.com/v1beta1
|
apiVersion: jingfang.example.com/v1
|
||||||
kind: MyKind
|
kind: MyKind
|
||||||
metadata:
|
metadata:
|
||||||
name: prod-x-mykind
|
name: prod-x-mykind
|
||||||
|
|||||||
@@ -463,7 +463,7 @@ spec:
|
|||||||
// TestFormatInput_service verifies a Service yaml is formatted correctly
|
// TestFormatInput_service verifies a Service yaml is formatted correctly
|
||||||
func TestFormatInput_validatingWebhookConfiguration(t *testing.T) {
|
func TestFormatInput_validatingWebhookConfiguration(t *testing.T) {
|
||||||
y := `
|
y := `
|
||||||
apiVersion: admissionregistration.k8s.io/v1beta1
|
apiVersion: admissionregistration.k8s.io/v1
|
||||||
kind: ValidatingWebhookConfiguration
|
kind: ValidatingWebhookConfiguration
|
||||||
metadata:
|
metadata:
|
||||||
name: <name of this configuration object>
|
name: <name of this configuration object>
|
||||||
@@ -490,7 +490,7 @@ webhooks:
|
|||||||
- v1beta1
|
- v1beta1
|
||||||
timeoutSeconds: 1
|
timeoutSeconds: 1
|
||||||
`
|
`
|
||||||
expected := `apiVersion: admissionregistration.k8s.io/v1beta1
|
expected := `apiVersion: admissionregistration.k8s.io/v1
|
||||||
kind: ValidatingWebhookConfiguration
|
kind: ValidatingWebhookConfiguration
|
||||||
metadata:
|
metadata:
|
||||||
name: <name of this configuration object>
|
name: <name of this configuration object>
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ var WhitelistedListSortKinds = newSet(
|
|||||||
// sorting list field elements
|
// sorting list field elements
|
||||||
var WhitelistedListSortApis = newSet(
|
var WhitelistedListSortApis = newSet(
|
||||||
"apps/v1", "apps/v1beta1", "apps/v1beta2", "batch/v1", "batch/v1beta1",
|
"apps/v1", "apps/v1beta1", "apps/v1beta2", "batch/v1", "batch/v1beta1",
|
||||||
"extensions/v1beta1", "v1", "admissionregistration.k8s.io/v1beta1")
|
"extensions/v1beta1", "v1", "admissionregistration.k8s.io/v1")
|
||||||
|
|
||||||
// WhitelistedListSortFields contains json paths to list fields that should
|
// WhitelistedListSortFields contains json paths to list fields that should
|
||||||
// be sorted, and the field they should be sorted by
|
// be sorted, and the field they should be sorted by
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ subjects:
|
|||||||
name: another
|
name: another
|
||||||
namespace: random
|
namespace: random
|
||||||
---
|
---
|
||||||
apiVersion: admissionregistration.k8s.io/v1beta1
|
apiVersion: admissionregistration.k8s.io/v1
|
||||||
kind: ValidatingWebhookConfiguration
|
kind: ValidatingWebhookConfiguration
|
||||||
metadata:
|
metadata:
|
||||||
name: example
|
name: example
|
||||||
@@ -94,21 +94,21 @@ webhooks:
|
|||||||
name: svc2
|
name: svc2
|
||||||
namespace: system
|
namespace: system
|
||||||
---
|
---
|
||||||
apiVersion: apiextensions.k8s.io/v1beta1
|
apiVersion: apiextensions.k8s.io/v1
|
||||||
kind: CustomResourceDefinition
|
kind: CustomResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
name: crd
|
name: crd
|
||||||
`,
|
`,
|
||||||
// Import note: The namespace transformer is in charge of
|
// Import note: The namespace transformer is in charge of
|
||||||
// the metadata.namespace field. The namespace transformer SHOULD
|
// the metadata.namespace field. The namespace transformer SHOULD
|
||||||
// NOT modify neither the "namespace" subfield within the
|
// NOT modify neither the "namespace" subfield within the
|
||||||
// ClusterRoleBinding.subjects field nor the "namespace"
|
// ClusterRoleBinding.subjects field nor the "namespace"
|
||||||
// subfield in the ValidatingWebhookConfiguration.webhooks field.
|
// subfield in the ValidatingWebhookConfiguration.webhooks field.
|
||||||
// This is the role of the namereference Transformer to handle
|
// This is the role of the namereference Transformer to handle
|
||||||
// object reference changes (prefix/suffix and namespace).
|
// object reference changes (prefix/suffix and namespace).
|
||||||
// For use cases involving simultaneous change of name and namespace,
|
// For use cases involving simultaneous change of name and namespace,
|
||||||
// refer to namespaces tests in pkg/target test suites.
|
// refer to namespaces tests in pkg/target test suites.
|
||||||
`
|
`
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata:
|
||||||
@@ -159,7 +159,7 @@ subjects:
|
|||||||
name: another
|
name: another
|
||||||
namespace: random
|
namespace: random
|
||||||
---
|
---
|
||||||
apiVersion: admissionregistration.k8s.io/v1beta1
|
apiVersion: admissionregistration.k8s.io/v1
|
||||||
kind: ValidatingWebhookConfiguration
|
kind: ValidatingWebhookConfiguration
|
||||||
metadata:
|
metadata:
|
||||||
name: example
|
name: example
|
||||||
@@ -175,7 +175,7 @@ webhooks:
|
|||||||
namespace: system
|
namespace: system
|
||||||
name: example2
|
name: example2
|
||||||
---
|
---
|
||||||
apiVersion: apiextensions.k8s.io/v1beta1
|
apiVersion: apiextensions.k8s.io/v1
|
||||||
kind: CustomResourceDefinition
|
kind: CustomResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
name: crd
|
name: crd
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ spec:
|
|||||||
ports:
|
ports:
|
||||||
- port: 7002
|
- port: 7002
|
||||||
---
|
---
|
||||||
apiVersion: apiextensions.k8s.io/v1beta1
|
apiVersion: apiextensions.k8s.io/v1
|
||||||
kind: CustomResourceDefinition
|
kind: CustomResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
name: crd
|
name: crd
|
||||||
@@ -67,7 +67,7 @@ spec:
|
|||||||
ports:
|
ports:
|
||||||
- port: 7002
|
- port: 7002
|
||||||
---
|
---
|
||||||
apiVersion: apiextensions.k8s.io/v1beta1
|
apiVersion: apiextensions.k8s.io/v1
|
||||||
kind: CustomResourceDefinition
|
kind: CustomResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
name: crd
|
name: crd
|
||||||
@@ -106,7 +106,7 @@ spec:
|
|||||||
- image: myapp
|
- image: myapp
|
||||||
name: main
|
name: main
|
||||||
---
|
---
|
||||||
apiVersion: apiextensions.k8s.io/v1beta1
|
apiVersion: apiextensions.k8s.io/v1
|
||||||
kind: CustomResourceDefinition
|
kind: CustomResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
name: crd
|
name: crd
|
||||||
@@ -134,7 +134,7 @@ spec:
|
|||||||
- image: myapp
|
- image: myapp
|
||||||
name: test-main
|
name: test-main
|
||||||
---
|
---
|
||||||
apiVersion: apiextensions.k8s.io/v1beta1
|
apiVersion: apiextensions.k8s.io/v1
|
||||||
kind: CustomResourceDefinition
|
kind: CustomResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
name: crd
|
name: crd
|
||||||
|
|||||||
Reference in New Issue
Block a user