fix kubectl get --show-kind

This commit is contained in:
Cao Shufeng
2018-05-20 13:26:53 +08:00
parent 2a989c60ff
commit a1bba62202
4 changed files with 72 additions and 11 deletions

View File

@@ -41,6 +41,11 @@ type PrintFlags struct {
OutputFormat *string
}
// SetKind sets the Kind option of humanreadable flags
func (f *PrintFlags) SetKind(kind schema.GroupKind) {
f.HumanReadableFlags.SetKind(kind)
}
// EnsureWithNamespace ensures that humanreadable flags return
// a printer capable of printing with a "namespace" column.
func (f *PrintFlags) EnsureWithNamespace() error {
@@ -49,8 +54,8 @@ func (f *PrintFlags) EnsureWithNamespace() error {
// EnsureWithKind ensures that humanreadable flags return
// a printer capable of including resource kinds.
func (f *PrintFlags) EnsureWithKind(kind schema.GroupKind) error {
return f.HumanReadableFlags.EnsureWithKind(kind)
func (f *PrintFlags) EnsureWithKind() error {
return f.HumanReadableFlags.EnsureWithKind()
}
// Copy returns a copy of PrintFlags for mutation