remove deprecated cfg and fn commands (#4930)

* remove deprecated cfg and fn commands

* fix lint error

* run gofmt
This commit is contained in:
Natasha Sarkar
2022-12-14 14:15:35 -06:00
committed by GitHub
parent e3981daf0e
commit ef60d5f9bb
37 changed files with 7 additions and 8441 deletions

View File

@@ -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)
}

View File

@@ -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)
}

View File

@@ -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)
}

View File

@@ -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)
}