mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
remove deprecated cfg and fn commands (#4930)
* remove deprecated cfg and fn commands * fix lint error * run gofmt
This commit is contained in:
@@ -1,57 +0,0 @@
|
||||
// Copyright 2019 The Kubernetes Authors.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package e2e
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestCreateSetter(t *testing.T) {
|
||||
tests := []test{
|
||||
{
|
||||
name: "create_setter",
|
||||
args: []string{"cfg", "create-setter", ".", "replicas", "3"},
|
||||
files: map[string]string{
|
||||
"deployment.yaml": `
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: nginx-deployment
|
||||
labels:
|
||||
app: nginx
|
||||
spec:
|
||||
replicas: 3
|
||||
`,
|
||||
"Krmfile": `
|
||||
apiVersion: config.k8s.io/v1alpha1
|
||||
kind: Krmfile
|
||||
`,
|
||||
},
|
||||
expectedFiles: map[string]string{
|
||||
"deployment.yaml": `
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: nginx-deployment
|
||||
labels:
|
||||
app: nginx
|
||||
spec:
|
||||
replicas: 3 # {"$openapi":"replicas"}
|
||||
`,
|
||||
"Krmfile": `
|
||||
apiVersion: config.k8s.io/v1alpha1
|
||||
kind: Krmfile
|
||||
openAPI:
|
||||
definitions:
|
||||
io.k8s.cli.setters.replicas:
|
||||
x-k8s-cli:
|
||||
setter:
|
||||
name: replicas
|
||||
value: "3"
|
||||
`,
|
||||
},
|
||||
},
|
||||
}
|
||||
runTests(t, tests)
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
// Copyright 2019 The Kubernetes Authors.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package e2e
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestInit(t *testing.T) {
|
||||
tests := []test{
|
||||
{
|
||||
name: "init",
|
||||
args: []string{"cfg", "init"},
|
||||
expectedFiles: map[string]string{
|
||||
"Krmfile": `
|
||||
apiVersion: config.k8s.io/v1alpha1
|
||||
kind: Krmfile
|
||||
`,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: "init",
|
||||
args: []string{"cfg", "init", "."},
|
||||
expectedFiles: map[string]string{
|
||||
"Krmfile": `
|
||||
apiVersion: config.k8s.io/v1alpha1
|
||||
kind: Krmfile
|
||||
`,
|
||||
},
|
||||
},
|
||||
}
|
||||
runTests(t, tests)
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
// Copyright 2019 The Kubernetes Authors.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package e2e
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestListSetters(t *testing.T) {
|
||||
tests := []test{
|
||||
{
|
||||
name: "set",
|
||||
args: []string{"cfg", "list-setters", "."},
|
||||
files: map[string]string{
|
||||
"deployment.yaml": `
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: nginx-deployment
|
||||
labels:
|
||||
app: nginx
|
||||
spec:
|
||||
replicas: 3 # {"$openapi":"replicas"}
|
||||
`,
|
||||
"Krmfile": `
|
||||
apiVersion: config.k8s.io/v1alpha1
|
||||
kind: Krmfile
|
||||
openAPI:
|
||||
definitions:
|
||||
io.k8s.cli.setters.replicas:
|
||||
x-k8s-cli:
|
||||
setter:
|
||||
name: replicas
|
||||
value: "3"
|
||||
`,
|
||||
},
|
||||
expectedStdOut: `
|
||||
./
|
||||
NAME VALUE SET BY DESCRIPTION COUNT REQUIRED IS SET
|
||||
replicas 3 1 No No
|
||||
`,
|
||||
},
|
||||
}
|
||||
runTests(t, tests)
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
// Copyright 2019 The Kubernetes Authors.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package e2e
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestSet(t *testing.T) {
|
||||
tests := []test{
|
||||
{
|
||||
name: "set",
|
||||
args: []string{"cfg", "set", ".", "replicas", "4"},
|
||||
files: map[string]string{
|
||||
"deployment.yaml": `
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: nginx-deployment
|
||||
labels:
|
||||
app: nginx
|
||||
spec:
|
||||
replicas: 3 # {"$openapi":"replicas"}
|
||||
`,
|
||||
"Krmfile": `
|
||||
apiVersion: config.k8s.io/v1alpha1
|
||||
kind: Krmfile
|
||||
openAPI:
|
||||
definitions:
|
||||
io.k8s.cli.setters.replicas:
|
||||
x-k8s-cli:
|
||||
setter:
|
||||
name: replicas
|
||||
value: "3"
|
||||
`,
|
||||
},
|
||||
expectedFiles: map[string]string{
|
||||
"deployment.yaml": `
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: nginx-deployment
|
||||
labels:
|
||||
app: nginx
|
||||
spec:
|
||||
replicas: 4 # {"$openapi":"replicas"}
|
||||
`,
|
||||
"Krmfile": `
|
||||
apiVersion: config.k8s.io/v1alpha1
|
||||
kind: Krmfile
|
||||
openAPI:
|
||||
definitions:
|
||||
io.k8s.cli.setters.replicas:
|
||||
x-k8s-cli:
|
||||
setter:
|
||||
name: replicas
|
||||
value: "4"
|
||||
isSet: true
|
||||
`,
|
||||
},
|
||||
},
|
||||
}
|
||||
runTests(t, tests)
|
||||
}
|
||||
Reference in New Issue
Block a user