mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 23:47:50 +00:00
update -o name format to kind.group/name
This commit is contained in:
@@ -64,8 +64,8 @@ func TestSetEnvLocal(t *testing.T) {
|
||||
cmd.SetOutput(buf)
|
||||
cmd.Flags().Set("output", "name")
|
||||
cmd.Flags().Set("local", "true")
|
||||
mapper, typer := f.Object()
|
||||
tf.Printer = &printers.NamePrinter{Decoders: []runtime.Decoder{codec}, Typer: typer, Mapper: mapper}
|
||||
_, typer := f.Object()
|
||||
tf.Printer = &printers.NamePrinter{Decoders: []runtime.Decoder{codec}, Typer: typer}
|
||||
|
||||
opts := EnvOptions{FilenameOptions: resource.FilenameOptions{
|
||||
Filenames: []string{"../../../../examples/storage/cassandra/cassandra-controller.yaml"}},
|
||||
@@ -78,7 +78,7 @@ func TestSetEnvLocal(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
if !strings.Contains(buf.String(), "replicationcontrollers/cassandra") {
|
||||
if !strings.Contains(buf.String(), "replicationcontroller/cassandra") {
|
||||
t.Errorf("did not set env: %s", buf.String())
|
||||
}
|
||||
}
|
||||
@@ -101,8 +101,8 @@ func TestSetMultiResourcesEnvLocal(t *testing.T) {
|
||||
cmd.SetOutput(buf)
|
||||
cmd.Flags().Set("output", "name")
|
||||
cmd.Flags().Set("local", "true")
|
||||
mapper, typer := f.Object()
|
||||
tf.Printer = &printers.NamePrinter{Decoders: []runtime.Decoder{codec}, Typer: typer, Mapper: mapper}
|
||||
_, typer := f.Object()
|
||||
tf.Printer = &printers.NamePrinter{Decoders: []runtime.Decoder{codec}, Typer: typer}
|
||||
|
||||
opts := EnvOptions{FilenameOptions: resource.FilenameOptions{
|
||||
Filenames: []string{"../../../../test/fixtures/pkg/kubectl/cmd/set/multi-resource-yaml.yaml"}},
|
||||
@@ -116,7 +116,7 @@ func TestSetMultiResourcesEnvLocal(t *testing.T) {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
|
||||
expectedOut := "replicationcontrollers/first-rc\nreplicationcontrollers/second-rc\n"
|
||||
expectedOut := "replicationcontroller/first-rc\nreplicationcontroller/second-rc\n"
|
||||
if buf.String() != expectedOut {
|
||||
t.Errorf("expected out:\n%s\nbut got:\n%s", expectedOut, buf.String())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user