mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
Refactor kustomize config command structure
- Create cfg, fn, live parent commands
This commit is contained in:
committed by
Phillip Wittrock
parent
73157c7141
commit
701c217791
@@ -11,7 +11,7 @@ func TestCreateSetter(t *testing.T) {
|
||||
tests := []test{
|
||||
{
|
||||
name: "create_setter",
|
||||
args: []string{"create-setter", ".", "replicas", "3"},
|
||||
args: []string{"cfg", "create-setter", ".", "replicas", "3"},
|
||||
files: map[string]string{
|
||||
"deployment.yaml": `
|
||||
apiVersion: apps/v1
|
||||
|
||||
@@ -678,7 +678,7 @@ metadata:
|
||||
testutil.AssertNoError(t, err)
|
||||
}
|
||||
|
||||
args := append([]string{"run", "."}, tt.args(binDir)...)
|
||||
args := append([]string{"fn", "run", "."}, tt.args(binDir)...)
|
||||
cmd := exec.Command(filepath.Join(binDir, kyamlBin), args...)
|
||||
cmd.Dir = dir
|
||||
var stdErr, stdOut bytes.Buffer
|
||||
@@ -732,7 +732,7 @@ func build() string {
|
||||
}
|
||||
|
||||
build = exec.Command("go", "build", "-o", filepath.Join(binDir, kyamlBin))
|
||||
build.Dir = filepath.Join("..", "..", "..")
|
||||
build.Dir = filepath.Join("..", "..", "..", "kubectl-krm")
|
||||
build.Stdout = os.Stdout
|
||||
build.Stderr = os.Stderr
|
||||
err = build.Run()
|
||||
@@ -763,11 +763,11 @@ var (
|
||||
)
|
||||
|
||||
func init() {
|
||||
kyamlBin = "kyaml"
|
||||
kyamlBin = "kubectl-krm"
|
||||
e2econtainerconfigBin = "e2econtainerconfig"
|
||||
|
||||
if runtime.GOOS == "windows" {
|
||||
kyamlBin = "kyaml.exe"
|
||||
kyamlBin = "kubectl-krm.exe"
|
||||
e2econtainerconfigBin = "e2econtainerconfig.exe"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ func TestInit(t *testing.T) {
|
||||
tests := []test{
|
||||
{
|
||||
name: "init",
|
||||
args: []string{"init"},
|
||||
args: []string{"cfg", "init"},
|
||||
expectedFiles: map[string]string{
|
||||
"Krmfile": `
|
||||
apiVersion: config.k8s.io/v1alpha1
|
||||
@@ -20,7 +20,7 @@ kind: Krmfile
|
||||
|
||||
{
|
||||
name: "init",
|
||||
args: []string{"init", "."},
|
||||
args: []string{"cfg", "init", "."},
|
||||
expectedFiles: map[string]string{
|
||||
"Krmfile": `
|
||||
apiVersion: config.k8s.io/v1alpha1
|
||||
|
||||
@@ -9,7 +9,7 @@ func TestListSetters(t *testing.T) {
|
||||
tests := []test{
|
||||
{
|
||||
name: "set",
|
||||
args: []string{"list-setters", "."},
|
||||
args: []string{"cfg", "list-setters", "."},
|
||||
files: map[string]string{
|
||||
"deployment.yaml": `
|
||||
apiVersion: apps/v1
|
||||
|
||||
@@ -9,7 +9,7 @@ func TestSet(t *testing.T) {
|
||||
tests := []test{
|
||||
{
|
||||
name: "set",
|
||||
args: []string{"set", ".", "replicas", "4"},
|
||||
args: []string{"cfg", "set", ".", "replicas", "4"},
|
||||
files: map[string]string{
|
||||
"deployment.yaml": `
|
||||
apiVersion: apps/v1
|
||||
|
||||
Reference in New Issue
Block a user