// https://github.com/kubernetes-sigs/kustomize/issues/3280
// These tests document behavior that will change
github.com/kubernetes-sigs/kustomize/issues/3280
These tests document behavior that will change
// https : // github . com / kubernetes - sigs / kustomize / issues / 3280 // These tests document behavior that will change
func TestChangeName(t *testing.T) {
	th := kusttest_test.MakeHarness(t)
	th.WriteF("deployment.yaml", `
apiVersion: v1
kind: Deployment
metadata:
  name: old-name
spec:
  template:
    spec:
      containers:
        - name: nginx
          image: nginx
`)
	th.WriteF("patch.yaml", `
apiVersion: v1
kind: Deployment
metadata:
  name: new-name
`)
	th.WriteK(".", `
resources:
- deployment.yaml
patches:
- path: patch.yaml
  target:
    kind: Deployment
  options: 
    allowNameChange: true
`)
	options := th.MakeDefaultOptions()
	m := th.Run(".", options)
	th.AssertActualEqualsExpected(m, `
apiVersion: v1
kind: Deployment
metadata:
  name: new-name
spec:
  template:
    spec:
      containers:
      - image: nginx
        name: nginx
`)
}
func TestChangeName ( t * testing . T ) { th := kusttest_test . MakeHarness ( t ) th . WriteF ( " " , `
apiVersion: v1
kind: Deployment
metadata:
  name: old-name
spec:
  template:
    spec:
      containers:
        - name: nginx
          image: nginx
` ) th . WriteF ( " " , `
apiVersion: v1
kind: Deployment
metadata:
  name: new-name
` ) th . WriteK ( " " , `
resources:
- deployment.yaml

patches:
- path: patch.yaml
  target:
    kind: Deployment
  options: 
    allowNameChange: true
` ) options := th . MakeDefaultOptions ( ) m := th . Run ( " " , options ) th . AssertActualEqualsExpected ( m , `
apiVersion: v1
kind: Deployment
metadata:
  name: new-name
spec:
  template:
    spec:
      containers:
      - image: nginx
        name: nginx
` ) }
github.com/kubernetes-sigs/kustomize/issues/3280
These tests document behavior that will change
github . com / kubernetes - sigs / kustomize / issues / 3280 These tests document behavior that will change