mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 01:14:22 +00:00
141 lines
1.1 KiB
Go
141 lines
1.1 KiB
Go
// Copyright 2019 The Kubernetes Authors.
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package merge2_test
|
|
|
|
var listTestCases = []testCase{
|
|
{`replace List -- different value in dest`,
|
|
`
|
|
kind: Deployment
|
|
items:
|
|
- 1
|
|
- 2
|
|
- 3
|
|
`,
|
|
`
|
|
kind: Deployment
|
|
items:
|
|
- 0
|
|
- 1
|
|
`,
|
|
`
|
|
kind: Deployment
|
|
items:
|
|
- 1
|
|
- 2
|
|
- 3
|
|
`,
|
|
},
|
|
|
|
{`replace List -- missing from dest`,
|
|
`
|
|
kind: Deployment
|
|
items:
|
|
- 1
|
|
- 2
|
|
- 3
|
|
`,
|
|
`
|
|
kind: Deployment
|
|
`,
|
|
`
|
|
kind: Deployment
|
|
items:
|
|
- 1
|
|
- 2
|
|
- 3
|
|
`,
|
|
},
|
|
|
|
//
|
|
// Test Case
|
|
//
|
|
{`keep List -- same value in src and dest`,
|
|
`
|
|
kind: Deployment
|
|
items:
|
|
- 1
|
|
- 2
|
|
- 3
|
|
`,
|
|
`
|
|
kind: Deployment
|
|
items:
|
|
- 1
|
|
- 2
|
|
- 3
|
|
`,
|
|
`
|
|
kind: Deployment
|
|
items:
|
|
- 1
|
|
- 2
|
|
- 3
|
|
`,
|
|
},
|
|
|
|
//
|
|
// Test Case
|
|
//
|
|
{`keep List -- unspecified in src`,
|
|
`
|
|
kind: Deployment
|
|
`,
|
|
`
|
|
kind: Deployment
|
|
items:
|
|
- 1
|
|
- 2
|
|
- 3
|
|
`,
|
|
`
|
|
kind: Deployment
|
|
items:
|
|
- 1
|
|
- 2
|
|
- 3
|
|
`,
|
|
},
|
|
|
|
//
|
|
// Test Case
|
|
//
|
|
{`remove List -- null in src`,
|
|
`
|
|
kind: Deployment
|
|
items: null
|
|
`,
|
|
`
|
|
kind: Deployment
|
|
items:
|
|
- 1
|
|
- 2
|
|
- 3
|
|
`,
|
|
`
|
|
kind: Deployment
|
|
`,
|
|
},
|
|
|
|
//
|
|
// Test Case
|
|
//
|
|
{`remove list -- empty in src`,
|
|
`
|
|
kind: Deployment
|
|
items: {}
|
|
`,
|
|
`
|
|
kind: Deployment
|
|
items:
|
|
- 1
|
|
- 2
|
|
- 3
|
|
`,
|
|
`
|
|
kind: Deployment
|
|
items: {}
|
|
`,
|
|
},
|
|
}
|