Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump ResourceList from v1alpha1 to v1 #4249

Merged
merged 1 commit into from Oct 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions cmd/config/internal/commands/cmdwrap_test.go
Expand Up @@ -14,7 +14,7 @@ import (
)

const (
input = `apiVersion: config.kubernetes.io/v1alpha1
input = `apiVersion: config.kubernetes.io/v1
kind: ResourceList
functionConfig:
metadata:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmd/config/internal/commands/cmdxargs_test.go
Expand Up @@ -39,7 +39,7 @@ functionConfig:
- 4
`

resourceInput = `apiVersion: config.kubernetes.io/v1alpha1
resourceInput = `apiVersion: config.kubernetes.io/v1
kind: ResourceList
items:
- apiVersion: apps/v1
Expand Down
8 changes: 4 additions & 4 deletions cmd/config/internal/commands/sink_test.go
Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions cmd/config/internal/commands/source_test.go
Expand Up @@ -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
Expand Down Expand Up @@ -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}}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}}
Expand Down
8 changes: 4 additions & 4 deletions cmd/pluginator/internal/krmfunction/converter_test.go
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions functions/examples/application-cr/image/main_test.go
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions kyaml/fn/framework/command/example_test.go
Expand Up @@ -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:
Expand All @@ -61,7 +61,7 @@ functionConfig:
}

// Output:
// apiVersion: config.kubernetes.io/v1alpha1
// apiVersion: config.kubernetes.io/v1
// kind: ResourceList
// items:
// - apiVersion: apps/v1
Expand Down Expand Up @@ -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:
Expand All @@ -154,7 +154,7 @@ functionConfig:
}

// Output:
// apiVersion: config.kubernetes.io/v1alpha1
// apiVersion: config.kubernetes.io/v1
// kind: ResourceList
// items:
// - apiVersion: apps/v1
Expand Down Expand Up @@ -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:
Expand All @@ -268,7 +268,7 @@ functionConfig:
}

// Output:
// apiVersion: config.kubernetes.io/v1alpha1
// apiVersion: config.kubernetes.io/v1
// kind: ResourceList
// items:
// - apiVersion: apps/v1
Expand Down Expand Up @@ -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:
Expand All @@ -362,7 +362,7 @@ items:
}

// Output:
// apiVersion: config.kubernetes.io/v1alpha1
// apiVersion: config.kubernetes.io/v1
// kind: ResourceList
// items:
// - apiVersion: apps/v1
Expand Down
24 changes: 12 additions & 12 deletions kyaml/fn/framework/example_test.go
Expand Up @@ -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:
Expand Down Expand Up @@ -60,7 +60,7 @@ functionConfig:
}

// Output:
// apiVersion: config.kubernetes.io/v1alpha1
// apiVersion: config.kubernetes.io/v1
// kind: ResourceList
// items:
// - apiVersion: apps/v1
Expand All @@ -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:
Expand Down Expand Up @@ -150,7 +150,7 @@ metadata:
}

// Output:
// apiVersion: config.kubernetes.io/v1alpha1
// apiVersion: config.kubernetes.io/v1
// kind: ResourceList
// items:
// - apiVersion: apps/v1
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -501,7 +501,7 @@ functionConfig:
}

// Output:
// apiVersion: config.kubernetes.io/v1alpha1
// apiVersion: config.kubernetes.io/v1
// kind: ResourceList
// items:
// - apiVersion: apps/v1
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -575,7 +575,7 @@ items:
}

// Output:
// apiVersion: config.kubernetes.io/v1beta1
// apiVersion: config.kubernetes.io/v1
// kind: ResourceList
// items:
// - apiVersion: apps/v1
Expand All @@ -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
Expand Down Expand Up @@ -629,7 +629,7 @@ items:
}

// Output:
// apiVersion: config.kubernetes.io/v1beta1
// apiVersion: config.kubernetes.io/v1
// kind: ResourceList
// items:
// - apiVersion: apps/v1
Expand Down Expand Up @@ -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
Expand All @@ -1011,7 +1011,7 @@ functionConfig:
}

// Output:
// apiVersion: config.kubernetes.io/v1beta1
// apiVersion: config.kubernetes.io/v1
// kind: ResourceList
// items:
// - apiVersion: apps/v1
Expand Down
4 changes: 2 additions & 2 deletions kyaml/fn/framework/framework_test.go
Expand Up @@ -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
Expand All @@ -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
Expand Down