mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-07-18 02:01:29 +00:00
Make the replica transformer kind aware.
The previous implementation had a bug and poorly handled types that should not have a `spec: replica:` field. Documentation is updated to reflect the change in behavior, and better highlights the cases where a patch should be used instead of this shorthand.
This commit is contained in:
@@ -45,7 +45,7 @@ fieldSpecs:
|
|||||||
create: true
|
create: true
|
||||||
kind: StatefulSet
|
kind: StatefulSet
|
||||||
`, `
|
`, `
|
||||||
apiVersion: builtin
|
apiVersion: apps/v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: myapp
|
name: myapp
|
||||||
@@ -54,21 +54,21 @@ spec:
|
|||||||
- port: 1111
|
- port: 1111
|
||||||
targetport: 1111
|
targetport: 1111
|
||||||
---
|
---
|
||||||
apiVersion: builtin
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: otherapp
|
name: otherapp
|
||||||
spec:
|
spec:
|
||||||
replicas: 5
|
replicas: 5
|
||||||
---
|
---
|
||||||
apiVersion: builtin
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: myapp
|
name: myapp
|
||||||
spec:
|
spec:
|
||||||
replicas: 5
|
replicas: 5
|
||||||
---
|
---
|
||||||
apiVersion: builtin
|
apiVersion: apps/v1
|
||||||
kind: StatefulSet
|
kind: StatefulSet
|
||||||
metadata:
|
metadata:
|
||||||
name: myapp
|
name: myapp
|
||||||
@@ -77,7 +77,7 @@ spec:
|
|||||||
matchLabels:
|
matchLabels:
|
||||||
app: app
|
app: app
|
||||||
---
|
---
|
||||||
apiVersion: builtin
|
apiVersion: apps/v1
|
||||||
kind: ReplicaSet
|
kind: ReplicaSet
|
||||||
metadata:
|
metadata:
|
||||||
name: myapp
|
name: myapp
|
||||||
@@ -86,7 +86,7 @@ spec:
|
|||||||
matchLabels:
|
matchLabels:
|
||||||
app: app
|
app: app
|
||||||
---
|
---
|
||||||
apiVersion: builtin
|
apiVersion: apps/v1
|
||||||
kind: ReplicationController
|
kind: ReplicationController
|
||||||
metadata:
|
metadata:
|
||||||
name: myapp
|
name: myapp
|
||||||
@@ -97,7 +97,7 @@ spec:
|
|||||||
`)
|
`)
|
||||||
|
|
||||||
th.AssertActualEqualsExpected(rm, `
|
th.AssertActualEqualsExpected(rm, `
|
||||||
apiVersion: builtin
|
apiVersion: apps/v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: myapp
|
name: myapp
|
||||||
@@ -106,21 +106,21 @@ spec:
|
|||||||
- port: 1111
|
- port: 1111
|
||||||
targetport: 1111
|
targetport: 1111
|
||||||
---
|
---
|
||||||
apiVersion: builtin
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: myapp
|
name: myapp
|
||||||
spec:
|
spec:
|
||||||
replicas: 23
|
replicas: 23
|
||||||
---
|
---
|
||||||
apiVersion: builtin
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: otherapp
|
name: otherapp
|
||||||
spec:
|
spec:
|
||||||
replicas: 5
|
replicas: 5
|
||||||
---
|
---
|
||||||
apiVersion: builtin
|
apiVersion: apps/v1
|
||||||
kind: StatefulSet
|
kind: StatefulSet
|
||||||
metadata:
|
metadata:
|
||||||
name: myapp
|
name: myapp
|
||||||
@@ -130,7 +130,7 @@ spec:
|
|||||||
matchLabels:
|
matchLabels:
|
||||||
app: app
|
app: app
|
||||||
---
|
---
|
||||||
apiVersion: builtin
|
apiVersion: apps/v1
|
||||||
kind: ReplicaSet
|
kind: ReplicaSet
|
||||||
metadata:
|
metadata:
|
||||||
name: myapp
|
name: myapp
|
||||||
@@ -140,7 +140,7 @@ spec:
|
|||||||
matchLabels:
|
matchLabels:
|
||||||
app: app
|
app: app
|
||||||
---
|
---
|
||||||
apiVersion: builtin
|
apiVersion: apps/v1
|
||||||
kind: ReplicationController
|
kind: ReplicationController
|
||||||
metadata:
|
metadata:
|
||||||
name: myapp
|
name: myapp
|
||||||
|
|||||||
Reference in New Issue
Block a user