Skip to content

Commit dac2b1d

Browse files
committed
update printflags on create cmds
1 parent f0b286e commit dac2b1d

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

pkg/oc/cli/cmd/create/create.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import (
55

66
"github.com/spf13/cobra"
77

8-
"k8s.io/kubernetes/pkg/api/legacyscheme"
9-
"k8s.io/kubernetes/pkg/kubectl/cmd/create"
8+
"github.com/openshift/origin/pkg/oc/util/ocscheme"
109
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
1110
"k8s.io/kubernetes/pkg/kubectl/genericclioptions"
1211
"k8s.io/kubernetes/pkg/kubectl/genericclioptions/printers"
@@ -17,7 +16,7 @@ type CreateSubcommandOptions struct {
1716
genericclioptions.IOStreams
1817

1918
// PrintFlags holds options necessary for obtaining a printer
20-
PrintFlags *create.PrintFlags
19+
PrintFlags *genericclioptions.PrintFlags
2120
// Name of resource being created
2221
Name string
2322
// DryRun is true if the command should be simulated but not run against the server
@@ -31,7 +30,7 @@ type CreateSubcommandOptions struct {
3130

3231
func NewCreateSubcommandOptions(ioStreams genericclioptions.IOStreams) *CreateSubcommandOptions {
3332
return &CreateSubcommandOptions{
34-
PrintFlags: create.NewPrintFlags("created", legacyscheme.Scheme),
33+
PrintFlags: genericclioptions.NewPrintFlags("created").WithTypeSetter(ocscheme.PrintingInternalScheme),
3534
IOStreams: ioStreams,
3635
}
3736
}

pkg/oc/cli/cmd/create/route.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@ package create
33
import (
44
"fmt"
55

6+
"github.com/openshift/origin/pkg/oc/util/ocscheme"
67
"github.com/spf13/cobra"
78

89
"k8s.io/apimachinery/pkg/api/meta"
9-
"k8s.io/kubernetes/pkg/api/legacyscheme"
1010
kclientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
11-
"k8s.io/kubernetes/pkg/kubectl/cmd/create"
1211
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
1312
kcmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
1413
"k8s.io/kubernetes/pkg/kubectl/genericclioptions"
@@ -44,7 +43,7 @@ func NewCmdCreateRoute(fullName string, f kcmdutil.Factory, streams genericcliop
4443
// CreateRouteSubcommandOptions is an options struct to support create subcommands
4544
type CreateRouteSubcommandOptions struct {
4645
// PrintFlags holds options necessary for obtaining a printer
47-
PrintFlags *create.PrintFlags
46+
PrintFlags *genericclioptions.PrintFlags
4847
// Name of resource being created
4948
Name string
5049
ServiceName string
@@ -66,7 +65,7 @@ type CreateRouteSubcommandOptions struct {
6665

6766
func NewCreateRouteSubcommandOptions(ioStreams genericclioptions.IOStreams) *CreateRouteSubcommandOptions {
6867
return &CreateRouteSubcommandOptions{
69-
PrintFlags: create.NewPrintFlags("created", legacyscheme.Scheme),
68+
PrintFlags: genericclioptions.NewPrintFlags("created").WithTypeSetter(ocscheme.PrintingInternalScheme),
7069
IOStreams: ioStreams,
7170
}
7271
}

0 commit comments

Comments
 (0)