2017-05-26 23:00:01 +00:00
|
|
|
/*
|
|
|
|
Copyright 2017 The Kubernetes Authors.
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
package storage
|
|
|
|
|
|
|
|
import (
|
2018-04-24 15:10:34 +00:00
|
|
|
"context"
|
|
|
|
|
2018-01-30 18:30:57 +00:00
|
|
|
metav1beta1 "k8s.io/apimachinery/pkg/apis/meta/v1beta1"
|
2017-05-26 23:00:01 +00:00
|
|
|
"k8s.io/apimachinery/pkg/runtime"
|
|
|
|
"k8s.io/kubernetes/pkg/printers"
|
|
|
|
)
|
|
|
|
|
|
|
|
type TableConvertor struct {
|
|
|
|
printers.TablePrinter
|
|
|
|
}
|
|
|
|
|
2018-04-24 15:10:34 +00:00
|
|
|
func (c TableConvertor) ConvertToTable(ctx context.Context, obj runtime.Object, tableOptions runtime.Object) (*metav1beta1.Table, error) {
|
2017-05-26 23:00:01 +00:00
|
|
|
return c.TablePrinter.PrintTable(obj, printers.PrintOptions{Wide: true})
|
|
|
|
}
|