mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-17 18:25:26 +00:00
bump ResourceList from v1alpha1 to v1
This commit is contained in:
@@ -14,7 +14,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
input = `apiVersion: config.kubernetes.io/v1alpha1
|
||||
input = `apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
functionConfig:
|
||||
metadata:
|
||||
@@ -68,7 +68,7 @@ items:
|
||||
name: test
|
||||
`
|
||||
|
||||
output = `apiVersion: config.kubernetes.io/v1alpha1
|
||||
output = `apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- apiVersion: apps/v1
|
||||
@@ -127,7 +127,7 @@ items:
|
||||
targetPort: 8080
|
||||
`
|
||||
|
||||
outputNoMerge = `apiVersion: config.kubernetes.io/v1alpha1
|
||||
outputNoMerge = `apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- apiVersion: apps/v1
|
||||
@@ -183,7 +183,7 @@ items:
|
||||
targetPort: 8080
|
||||
`
|
||||
|
||||
outputOverride = `apiVersion: config.kubernetes.io/v1alpha1
|
||||
outputOverride = `apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- apiVersion: apps/v1
|
||||
|
||||
@@ -39,7 +39,7 @@ functionConfig:
|
||||
- 4
|
||||
`
|
||||
|
||||
resourceInput = `apiVersion: config.kubernetes.io/v1alpha1
|
||||
resourceInput = `apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- apiVersion: apps/v1
|
||||
|
||||
@@ -22,7 +22,7 @@ func TestSinkCommand(t *testing.T) {
|
||||
defer os.RemoveAll(d)
|
||||
|
||||
r := commands.GetSinkRunner("")
|
||||
r.Command.SetIn(bytes.NewBufferString(`apiVersion: config.kubernetes.io/v1alpha1
|
||||
r.Command.SetIn(bytes.NewBufferString(`apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- kind: Deployment
|
||||
@@ -144,7 +144,7 @@ func TestSinkCommandJSON(t *testing.T) {
|
||||
defer os.RemoveAll(d)
|
||||
|
||||
r := commands.GetSinkRunner("")
|
||||
r.Command.SetIn(bytes.NewBufferString(`apiVersion: config.kubernetes.io/v1alpha1
|
||||
r.Command.SetIn(bytes.NewBufferString(`apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- {"kind": "Deployment", "metadata": {"labels": {"app": "nginx2"}, "name": "foo",
|
||||
@@ -191,7 +191,7 @@ func TestSinkCommand_Stdout(t *testing.T) {
|
||||
// fmt the files
|
||||
out := &bytes.Buffer{}
|
||||
r := commands.GetSinkRunner("")
|
||||
r.Command.SetIn(bytes.NewBufferString(`apiVersion: config.kubernetes.io/v1alpha1
|
||||
r.Command.SetIn(bytes.NewBufferString(`apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- kind: Deployment
|
||||
@@ -305,7 +305,7 @@ func TestSinkCommandJSON_Stdout(t *testing.T) {
|
||||
// fmt the files
|
||||
out := &bytes.Buffer{}
|
||||
r := commands.GetSinkRunner("")
|
||||
r.Command.SetIn(bytes.NewBufferString(`apiVersion: config.kubernetes.io/v1alpha1
|
||||
r.Command.SetIn(bytes.NewBufferString(`apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- {"kind": "Deployment", "metadata": {"labels": {"app": "nginx2"}, "name": "foo",
|
||||
|
||||
@@ -81,7 +81,7 @@ spec:
|
||||
return
|
||||
}
|
||||
|
||||
if !assert.Equal(t, `apiVersion: config.kubernetes.io/v1alpha1
|
||||
if !assert.Equal(t, `apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- kind: Deployment
|
||||
@@ -199,7 +199,7 @@ func TestSourceCommandJSON(t *testing.T) {
|
||||
return
|
||||
}
|
||||
|
||||
if !assert.Equal(t, `apiVersion: config.kubernetes.io/v1alpha1
|
||||
if !assert.Equal(t, `apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- {"kind": "Deployment", "metadata": {"labels": {"app": "nginx2"}, "name": "foo", "annotations": {"app": "nginx2", config.kubernetes.io/index: '0', config.kubernetes.io/path: 'f1.json', internal.config.kubernetes.io/index: '0', internal.config.kubernetes.io/path: 'f1.json'}}, "spec": {"replicas": 1}}
|
||||
@@ -246,7 +246,7 @@ spec:
|
||||
return
|
||||
}
|
||||
|
||||
if !assert.Equal(t, `apiVersion: config.kubernetes.io/v1alpha1
|
||||
if !assert.Equal(t, `apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- kind: Deployment
|
||||
@@ -309,7 +309,7 @@ func TestSourceCommandJSON_Stdin(t *testing.T) {
|
||||
return
|
||||
}
|
||||
|
||||
if !assert.Equal(t, `apiVersion: config.kubernetes.io/v1alpha1
|
||||
if !assert.Equal(t, `apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- {"kind": "Deployment", "metadata": {"labels": {"app": "nginx2"}, "name": "foo", "annotations": {"app": "nginx2", config.kubernetes.io/index: '0', internal.config.kubernetes.io/index: '0'}}, "spec": {"replicas": 1}}
|
||||
|
||||
@@ -74,7 +74,7 @@ func (p *plugin) Transform(rm resmap.ResMap) error {
|
||||
|
||||
func getTransformerInputResource() []byte {
|
||||
return []byte(`
|
||||
apiVersion: config.kubernetes.io/v1beta1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
functionConfig:
|
||||
apiVersion: foo-corp.com/v1
|
||||
@@ -128,7 +128,7 @@ func TestTransformerConverter(t *testing.T) {
|
||||
assert.NoError(t, err)
|
||||
|
||||
output := runKrmFunction(t, getTransformerInputResource(), filepath.Join(dir, "output"))
|
||||
assert.Equal(t, `apiVersion: config.kubernetes.io/v1beta1
|
||||
assert.Equal(t, `apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- apiVersion: apps/v1
|
||||
@@ -193,7 +193,7 @@ func (p *plugin) Generate() (resmap.ResMap, error) {
|
||||
|
||||
func getGeneratorInputResource() []byte {
|
||||
return []byte(`
|
||||
apiVersion: config.kubernetes.io/v1beta1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
functionConfig:
|
||||
apiVersion: foo-corp.com/v1
|
||||
@@ -224,7 +224,7 @@ func TestGeneratorConverter(t *testing.T) {
|
||||
err := c.Convert()
|
||||
assert.NoError(t, err)
|
||||
output := runKrmFunction(t, getGeneratorInputResource(), filepath.Join(dir, "output"))
|
||||
assert.Equal(t, `apiVersion: config.kubernetes.io/v1beta1
|
||||
assert.Equal(t, `apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- apiVersion: v1
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
var input = `apiVersion: config.kubernetes.io/v1alpha1
|
||||
var input = `apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- apiVersion: v1
|
||||
@@ -89,7 +89,7 @@ functionConfig:
|
||||
url: https://metrics/internal/worldpress-01/web-app
|
||||
`
|
||||
|
||||
var output = `apiVersion: config.kubernetes.io/v1alpha1
|
||||
var output = `apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- apiVersion: v1
|
||||
|
||||
@@ -37,7 +37,7 @@ func ExampleBuild_modify() {
|
||||
|
||||
// for testing purposes only -- normally read from stdin when Executing
|
||||
cmd.SetIn(bytes.NewBufferString(`
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
# items are provided as nodes
|
||||
items:
|
||||
@@ -61,7 +61,7 @@ functionConfig:
|
||||
}
|
||||
|
||||
// Output:
|
||||
// apiVersion: config.kubernetes.io/v1alpha1
|
||||
// apiVersion: config.kubernetes.io/v1
|
||||
// kind: ResourceList
|
||||
// items:
|
||||
// - apiVersion: apps/v1
|
||||
@@ -133,7 +133,7 @@ metadata:
|
||||
|
||||
// for testing purposes only -- normally read from stdin when Executing
|
||||
cmd.SetIn(bytes.NewBufferString(`
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
# items are provided as nodes
|
||||
items:
|
||||
@@ -154,7 +154,7 @@ functionConfig:
|
||||
}
|
||||
|
||||
// Output:
|
||||
// apiVersion: config.kubernetes.io/v1alpha1
|
||||
// apiVersion: config.kubernetes.io/v1
|
||||
// kind: ResourceList
|
||||
// items:
|
||||
// - apiVersion: apps/v1
|
||||
@@ -241,7 +241,7 @@ metadata:
|
||||
|
||||
// for testing purposes only -- normally read from stdin when Executing
|
||||
cmd.SetIn(bytes.NewBufferString(`
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
# items are provided as nodes
|
||||
items:
|
||||
@@ -268,7 +268,7 @@ functionConfig:
|
||||
}
|
||||
|
||||
// Output:
|
||||
// apiVersion: config.kubernetes.io/v1alpha1
|
||||
// apiVersion: config.kubernetes.io/v1
|
||||
// kind: ResourceList
|
||||
// items:
|
||||
// - apiVersion: apps/v1
|
||||
@@ -346,7 +346,7 @@ func ExampleBuild_validate() {
|
||||
cmd := command.Build(framework.ResourceListProcessorFunc(fn), command.StandaloneDisabled, true)
|
||||
// for testing purposes only -- normally read from stdin when Executing
|
||||
cmd.SetIn(bytes.NewBufferString(`
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
# items are provided as nodes
|
||||
items:
|
||||
@@ -362,7 +362,7 @@ items:
|
||||
}
|
||||
|
||||
// Output:
|
||||
// apiVersion: config.kubernetes.io/v1alpha1
|
||||
// apiVersion: config.kubernetes.io/v1
|
||||
// kind: ResourceList
|
||||
// items:
|
||||
// - apiVersion: apps/v1
|
||||
|
||||
@@ -23,7 +23,7 @@ const service = "Service"
|
||||
// ExampleSimpleProcessor_modify implements a function that sets an annotation on each resource.
|
||||
func ExampleSimpleProcessor_modify() {
|
||||
input := bytes.NewBufferString(`
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
# items are provided as nodes
|
||||
items:
|
||||
@@ -60,7 +60,7 @@ functionConfig:
|
||||
}
|
||||
|
||||
// Output:
|
||||
// apiVersion: config.kubernetes.io/v1alpha1
|
||||
// apiVersion: config.kubernetes.io/v1
|
||||
// kind: ResourceList
|
||||
// items:
|
||||
// - apiVersion: apps/v1
|
||||
@@ -86,7 +86,7 @@ functionConfig:
|
||||
// If the resource already exists, it replaces the resource with a new copy.
|
||||
func ExampleSimpleProcessor_generateReplace() {
|
||||
input := bytes.NewBufferString(`
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
# items are provided as nodes
|
||||
items:
|
||||
@@ -150,7 +150,7 @@ metadata:
|
||||
}
|
||||
|
||||
// Output:
|
||||
// apiVersion: config.kubernetes.io/v1alpha1
|
||||
// apiVersion: config.kubernetes.io/v1
|
||||
// kind: ResourceList
|
||||
// items:
|
||||
// - apiVersion: apps/v1
|
||||
@@ -471,7 +471,7 @@ spec:
|
||||
// The second resource will be treated as a patch since its metadata matches the resource
|
||||
// generated by ResourceTemplates and MergeResources is true.
|
||||
rw := kio.ByteReadWriter{Reader: bytes.NewBufferString(`
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- kind: Deployment
|
||||
@@ -501,7 +501,7 @@ functionConfig:
|
||||
}
|
||||
|
||||
// Output:
|
||||
// apiVersion: config.kubernetes.io/v1alpha1
|
||||
// apiVersion: config.kubernetes.io/v1
|
||||
// kind: ResourceList
|
||||
// items:
|
||||
// - apiVersion: apps/v1
|
||||
@@ -543,7 +543,7 @@ func ExampleSelector_templatizeKinds() {
|
||||
}
|
||||
rw := &kio.ByteReadWriter{
|
||||
Reader: bytes.NewBufferString(`
|
||||
apiVersion: config.kubernetes.io/v1beta1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
functionConfig:
|
||||
kindName: Deployment
|
||||
@@ -575,7 +575,7 @@ items:
|
||||
}
|
||||
|
||||
// Output:
|
||||
// apiVersion: config.kubernetes.io/v1beta1
|
||||
// apiVersion: config.kubernetes.io/v1
|
||||
// kind: ResourceList
|
||||
// items:
|
||||
// - apiVersion: apps/v1
|
||||
@@ -595,7 +595,7 @@ func ExampleSelector_templatizeAnnotations() {
|
||||
Value string `yaml:"value"`
|
||||
}
|
||||
rw := &kio.ByteReadWriter{Reader: bytes.NewBufferString(`
|
||||
apiVersion: config.kubernetes.io/v1beta1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
functionConfig:
|
||||
value: bar
|
||||
@@ -629,7 +629,7 @@ items:
|
||||
}
|
||||
|
||||
// Output:
|
||||
// apiVersion: config.kubernetes.io/v1beta1
|
||||
// apiVersion: config.kubernetes.io/v1
|
||||
// kind: ResourceList
|
||||
// items:
|
||||
// - apiVersion: apps/v1
|
||||
@@ -995,7 +995,7 @@ func ExampleVersionedAPIProcessor() {
|
||||
}}}
|
||||
|
||||
source := &kio.ByteReadWriter{Reader: bytes.NewBufferString(`
|
||||
apiVersion: config.kubernetes.io/v1beta1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
functionConfig:
|
||||
apiVersion: example.com/v1alpha1
|
||||
@@ -1011,7 +1011,7 @@ functionConfig:
|
||||
}
|
||||
|
||||
// Output:
|
||||
// apiVersion: config.kubernetes.io/v1beta1
|
||||
// apiVersion: config.kubernetes.io/v1
|
||||
// kind: ResourceList
|
||||
// items:
|
||||
// - apiVersion: apps/v1
|
||||
|
||||
@@ -48,7 +48,7 @@ func TestExecute_Result(t *testing.T) {
|
||||
out := new(bytes.Buffer)
|
||||
source := &kio.ByteReadWriter{Reader: bytes.NewBufferString(`
|
||||
kind: ResourceList
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
items:
|
||||
- kind: Deployment
|
||||
apiVersion: v1
|
||||
@@ -63,7 +63,7 @@ items:
|
||||
|
||||
[error] : some error`)
|
||||
assert.Equal(t, 1, err.(*framework.Result).ExitCode())
|
||||
assert.Equal(t, `apiVersion: config.kubernetes.io/v1alpha1
|
||||
assert.Equal(t, `apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- kind: Deployment
|
||||
|
||||
@@ -35,7 +35,7 @@ func TestTemplateProcessor_ResourceTemplates(t *testing.T) {
|
||||
|
||||
out := new(bytes.Buffer)
|
||||
rw := &kio.ByteReadWriter{Reader: bytes.NewBufferString(`
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- apiVersion: v1
|
||||
@@ -47,7 +47,7 @@ functionConfig:
|
||||
|
||||
require.NoError(t, framework.Execute(p, rw))
|
||||
require.Equal(t, strings.TrimSpace(`
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- apiVersion: v1
|
||||
@@ -98,7 +98,7 @@ metadata:
|
||||
out := new(bytes.Buffer)
|
||||
|
||||
rw := &kio.ByteReadWriter{Reader: bytes.NewBufferString(`
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- apiVersion: apps/v1
|
||||
@@ -130,7 +130,7 @@ functionConfig:
|
||||
|
||||
require.NoError(t, framework.Execute(p, rw))
|
||||
require.Equal(t, strings.TrimSpace(`
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- apiVersion: apps/v1
|
||||
@@ -194,7 +194,7 @@ env:
|
||||
|
||||
out := new(bytes.Buffer)
|
||||
rw := &kio.ByteReadWriter{Reader: bytes.NewBufferString(`
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- apiVersion: apps/v1
|
||||
@@ -231,7 +231,7 @@ functionConfig:
|
||||
|
||||
require.NoError(t, framework.Execute(p, rw))
|
||||
require.Equal(t, strings.TrimSpace(`
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- apiVersion: apps/v1
|
||||
@@ -300,7 +300,7 @@ func TestTemplateProcessor_ContainerPatchTemplates_MultipleWorkloadKinds(t *test
|
||||
|
||||
out := new(bytes.Buffer)
|
||||
rw := &kio.ByteReadWriter{Writer: out, Reader: bytes.NewBufferString(`
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items: []
|
||||
functionConfig:
|
||||
@@ -591,7 +591,7 @@ func TestTemplateProcessor_AdditionalSchemas(t *testing.T) {
|
||||
out := new(bytes.Buffer)
|
||||
|
||||
rw := &kio.ByteReadWriter{Reader: bytes.NewBufferString(`
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- apiVersion: example.com/v1
|
||||
@@ -606,7 +606,7 @@ items:
|
||||
Writer: out}
|
||||
require.NoError(t, framework.Execute(p, rw))
|
||||
require.Equal(t, strings.TrimSpace(`
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- apiVersion: example.com/v1
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
kind: ResourceList
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
functionConfig:
|
||||
apiVersion: example.com/v1alpha1
|
||||
kind: JavaSpringBoot
|
||||
|
||||
@@ -62,7 +62,7 @@ func TestFunctionFilter_Filter(t *testing.T) {
|
||||
name: "default_file_path_annotation",
|
||||
run: testRun{
|
||||
output: `
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- apiVersion: apps/v1
|
||||
@@ -103,7 +103,7 @@ metadata:
|
||||
name: "no_default_file_path_annotation",
|
||||
run: testRun{
|
||||
output: `
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- apiVersion: apps/v1
|
||||
@@ -146,7 +146,7 @@ metadata:
|
||||
name: "write_read",
|
||||
run: testRun{
|
||||
output: `
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- apiVersion: v1
|
||||
@@ -203,7 +203,7 @@ metadata:
|
||||
{
|
||||
name: "write_results_file",
|
||||
run: testRun{
|
||||
output: `apiVersion: config.kubernetes.io/v1alpha1
|
||||
output: `apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- apiVersion: apps/v1
|
||||
@@ -283,7 +283,7 @@ metadata:
|
||||
run: testRun{
|
||||
err: fmt.Errorf("failed"),
|
||||
output: `
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- apiVersion: apps/v1
|
||||
@@ -363,7 +363,7 @@ metadata:
|
||||
run: testRun{
|
||||
err: fmt.Errorf("failed"),
|
||||
output: `
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- apiVersion: apps/v1
|
||||
@@ -440,7 +440,7 @@ metadata:
|
||||
noMakeResultsFile: true,
|
||||
run: testRun{
|
||||
output: `
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- apiVersion: apps/v1
|
||||
@@ -487,7 +487,7 @@ metadata:
|
||||
{
|
||||
name: "scope_resources_by_directory",
|
||||
run: testRun{
|
||||
expectedInput: `apiVersion: config.kubernetes.io/v1alpha1
|
||||
expectedInput: `apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- apiVersion: v1
|
||||
@@ -506,7 +506,7 @@ functionConfig:
|
||||
annotations:
|
||||
config.kubernetes.io/path: 'foo/bar.yaml'
|
||||
`,
|
||||
output: `apiVersion: config.kubernetes.io/v1alpha1
|
||||
output: `apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- apiVersion: v1
|
||||
@@ -578,7 +578,7 @@ metadata:
|
||||
{
|
||||
name: "scope_resources_by_directory_resources_missing_path",
|
||||
run: testRun{
|
||||
expectedInput: `apiVersion: config.kubernetes.io/v1alpha1
|
||||
expectedInput: `apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- apiVersion: v1
|
||||
@@ -597,7 +597,7 @@ functionConfig:
|
||||
annotations:
|
||||
config.kubernetes.io/path: 'foo/bar.yaml'
|
||||
`,
|
||||
output: `apiVersion: config.kubernetes.io/v1alpha1
|
||||
output: `apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- apiVersion: v1
|
||||
@@ -666,7 +666,7 @@ metadata:
|
||||
name: "scope_resources_global",
|
||||
instance: FunctionFilter{GlobalScope: true},
|
||||
run: testRun{
|
||||
expectedInput: `apiVersion: config.kubernetes.io/v1alpha1
|
||||
expectedInput: `apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- apiVersion: apps/v1
|
||||
@@ -693,7 +693,7 @@ functionConfig:
|
||||
annotations:
|
||||
config.kubernetes.io/path: 'foo/bar.yaml'
|
||||
`,
|
||||
output: `apiVersion: config.kubernetes.io/v1alpha1
|
||||
output: `apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- apiVersion: apps/v1
|
||||
@@ -770,7 +770,7 @@ metadata:
|
||||
{
|
||||
name: "scope_no_resources",
|
||||
run: testRun{
|
||||
expectedInput: `apiVersion: config.kubernetes.io/v1alpha1
|
||||
expectedInput: `apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items: []
|
||||
functionConfig:
|
||||
@@ -781,7 +781,7 @@ functionConfig:
|
||||
annotations:
|
||||
config.kubernetes.io/path: 'foo/bar.yaml'
|
||||
`,
|
||||
output: `apiVersion: config.kubernetes.io/v1alpha1
|
||||
output: `apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items: []
|
||||
functionConfig:
|
||||
@@ -840,7 +840,7 @@ metadata:
|
||||
{
|
||||
name: "scope_functions_dir",
|
||||
run: testRun{
|
||||
expectedInput: `apiVersion: config.kubernetes.io/v1alpha1
|
||||
expectedInput: `apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- apiVersion: v1
|
||||
@@ -859,7 +859,7 @@ functionConfig:
|
||||
annotations:
|
||||
config.kubernetes.io/path: 'foo/functions/bar.yaml'
|
||||
`,
|
||||
output: `apiVersion: config.kubernetes.io/v1alpha1
|
||||
output: `apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- apiVersion: v1
|
||||
@@ -931,7 +931,7 @@ metadata:
|
||||
{
|
||||
name: "copy_comments",
|
||||
run: testRun{
|
||||
expectedInput: `apiVersion: config.kubernetes.io/v1alpha1
|
||||
expectedInput: `apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- apiVersion: apps/v1
|
||||
@@ -959,7 +959,7 @@ functionConfig:
|
||||
config.kubernetes.io/path: 'foo/f.yaml'
|
||||
`,
|
||||
// delete the comment
|
||||
output: `apiVersion: config.kubernetes.io/v1alpha1
|
||||
output: `apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- apiVersion: apps/v1
|
||||
|
||||
@@ -18,7 +18,7 @@ import (
|
||||
|
||||
const (
|
||||
ResourceListKind = "ResourceList"
|
||||
ResourceListAPIVersion = "config.kubernetes.io/v1alpha1"
|
||||
ResourceListAPIVersion = "config.kubernetes.io/v1"
|
||||
)
|
||||
|
||||
// ByteReadWriter reads from an input and writes to an output.
|
||||
|
||||
@@ -33,7 +33,7 @@ func TestByteReader(t *testing.T) {
|
||||
//
|
||||
{
|
||||
name: "wrapped_resource_list",
|
||||
input: `apiVersion: config.kubernetes.io/v1alpha1
|
||||
input: `apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- kind: Deployment
|
||||
@@ -64,7 +64,7 @@ spec:
|
||||
//
|
||||
{
|
||||
name: "wrapped_resource_list_function_config",
|
||||
input: `apiVersion: config.kubernetes.io/v1alpha1
|
||||
input: `apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
functionConfig:
|
||||
foo: bar
|
||||
@@ -105,7 +105,7 @@ elems:
|
||||
//
|
||||
{
|
||||
name: "wrapped_resource_list_function_config_without_items",
|
||||
input: `apiVersion: config.kubernetes.io/v1alpha1
|
||||
input: `apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
functionConfig:
|
||||
foo: bar
|
||||
|
||||
@@ -26,7 +26,7 @@ func TestByteReadWriter(t *testing.T) {
|
||||
{
|
||||
name: "round_trip",
|
||||
input: `
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- kind: Deployment
|
||||
@@ -38,7 +38,7 @@ items:
|
||||
foo: bar
|
||||
`,
|
||||
expectedOutput: `
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- kind: Deployment
|
||||
@@ -54,7 +54,7 @@ items:
|
||||
{
|
||||
name: "function_config",
|
||||
input: `
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- kind: Deployment
|
||||
@@ -68,7 +68,7 @@ functionConfig:
|
||||
a: b # something
|
||||
`,
|
||||
expectedOutput: `
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- kind: Deployment
|
||||
@@ -86,7 +86,7 @@ functionConfig:
|
||||
{
|
||||
name: "results",
|
||||
input: `
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- kind: Deployment
|
||||
@@ -100,7 +100,7 @@ results:
|
||||
a: b # something
|
||||
`,
|
||||
expectedOutput: `
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- kind: Deployment
|
||||
@@ -118,7 +118,7 @@ results:
|
||||
{
|
||||
name: "drop_invalid_resource_list_field",
|
||||
input: `
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- kind: Deployment
|
||||
@@ -132,7 +132,7 @@ foo:
|
||||
a: b # something
|
||||
`,
|
||||
expectedOutput: `
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- kind: Deployment
|
||||
@@ -233,7 +233,7 @@ metadata:
|
||||
{
|
||||
name: "manual_override_wrap",
|
||||
input: `
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- kind: Deployment
|
||||
@@ -262,7 +262,7 @@ spec:
|
||||
{
|
||||
name: "manual_override_function_config",
|
||||
input: `
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- kind: Deployment
|
||||
@@ -276,7 +276,7 @@ functionConfig:
|
||||
a: b # something
|
||||
`,
|
||||
expectedOutput: `
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- kind: Deployment
|
||||
@@ -499,7 +499,7 @@ env:
|
||||
{
|
||||
name: "unwrap ResourceList with annotations",
|
||||
input: `
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- kind: Deployment
|
||||
|
||||
@@ -45,7 +45,7 @@ g:
|
||||
h:
|
||||
- i # has a list
|
||||
- j`,
|
||||
expectedOutput: `apiVersion: config.kubernetes.io/v1alpha1
|
||||
expectedOutput: `apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- a: b #first
|
||||
@@ -477,7 +477,7 @@ metadata:
|
||||
}`,
|
||||
},
|
||||
|
||||
expectedOutput: `apiVersion: config.kubernetes.io/v1alpha1
|
||||
expectedOutput: `apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- {"a": "b", "metadata": {"annotations": {"internal.config.kubernetes.io/path": "test.json"}}}
|
||||
|
||||
@@ -97,7 +97,7 @@ func TestEmptyInput(t *testing.T) {
|
||||
}
|
||||
|
||||
expected := `
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items: []
|
||||
`
|
||||
@@ -138,7 +138,7 @@ func TestEmptyInputWithFilter(t *testing.T) {
|
||||
}
|
||||
|
||||
expected := `
|
||||
apiVersion: config.kubernetes.io/v1alpha1
|
||||
apiVersion: config.kubernetes.io/v1
|
||||
kind: ResourceList
|
||||
items:
|
||||
- foo: bar
|
||||
|
||||
Reference in New Issue
Block a user