Implement 'kubectl get ... -o wide'
This commit is contained in:
@@ -72,6 +72,8 @@ func GetPrinter(format, formatArgument string) (ResourcePrinter, bool, error) {
|
||||
if err != nil {
|
||||
return nil, false, fmt.Errorf("error parsing template %s, %v\n", string(data), err)
|
||||
}
|
||||
case "wide":
|
||||
fallthrough
|
||||
case "":
|
||||
return nil, false, nil
|
||||
default:
|
||||
@@ -180,16 +182,18 @@ type HumanReadablePrinter struct {
|
||||
handlerMap map[reflect.Type]*handlerEntry
|
||||
noHeaders bool
|
||||
withNamespace bool
|
||||
wide bool
|
||||
columnLabels []string
|
||||
lastType reflect.Type
|
||||
}
|
||||
|
||||
// NewHumanReadablePrinter creates a HumanReadablePrinter.
|
||||
func NewHumanReadablePrinter(noHeaders, withNamespace bool, columnLabels []string) *HumanReadablePrinter {
|
||||
func NewHumanReadablePrinter(noHeaders, withNamespace bool, wide bool, columnLabels []string) *HumanReadablePrinter {
|
||||
printer := &HumanReadablePrinter{
|
||||
handlerMap: make(map[reflect.Type]*handlerEntry),
|
||||
noHeaders: noHeaders,
|
||||
withNamespace: withNamespace,
|
||||
wide: wide,
|
||||
columnLabels: columnLabels,
|
||||
}
|
||||
printer.addDefaultHandlers()
|
||||
@@ -197,10 +201,7 @@ func NewHumanReadablePrinter(noHeaders, withNamespace bool, columnLabels []strin
|
||||
}
|
||||
|
||||
// Handler adds a print handler with a given set of columns to HumanReadablePrinter instance.
|
||||
// printFunc is the function that will be called to print an object.
|
||||
// It must be of the following type:
|
||||
// func printFunc(object ObjectType, w io.Writer, withNamespace bool) error
|
||||
// where ObjectType is the type of the object that will be printed.
|
||||
// See validatePrintHandlerFunc for required method signature.
|
||||
func (h *HumanReadablePrinter) Handler(columns []string, printFunc interface{}) error {
|
||||
printFuncValue := reflect.ValueOf(printFunc)
|
||||
if err := h.validatePrintHandlerFunc(printFuncValue); err != nil {
|
||||
@@ -215,20 +216,25 @@ func (h *HumanReadablePrinter) Handler(columns []string, printFunc interface{})
|
||||
return nil
|
||||
}
|
||||
|
||||
// validatePrintHandlerFunc validates print handler signature.
|
||||
// printFunc is the function that will be called to print an object.
|
||||
// It must be of the following type:
|
||||
// func printFunc(object ObjectType, w io.Writer, withNamespace bool, wide bool, columnLabels []string) error
|
||||
// where ObjectType is the type of the object that will be printed.
|
||||
func (h *HumanReadablePrinter) validatePrintHandlerFunc(printFunc reflect.Value) error {
|
||||
if printFunc.Kind() != reflect.Func {
|
||||
return fmt.Errorf("invalid print handler. %#v is not a function", printFunc)
|
||||
}
|
||||
funcType := printFunc.Type()
|
||||
if funcType.NumIn() != 4 || funcType.NumOut() != 1 {
|
||||
if funcType.NumIn() != 5 || funcType.NumOut() != 1 {
|
||||
return fmt.Errorf("invalid print handler." +
|
||||
"Must accept 3 parameters and return 1 value.")
|
||||
"Must accept 5 parameters and return 1 value.")
|
||||
}
|
||||
if funcType.In(1) != reflect.TypeOf((*io.Writer)(nil)).Elem() ||
|
||||
funcType.In(3) != reflect.TypeOf((*[]string)(nil)).Elem() ||
|
||||
funcType.In(4) != reflect.TypeOf((*[]string)(nil)).Elem() ||
|
||||
funcType.Out(0) != reflect.TypeOf((*error)(nil)).Elem() {
|
||||
return fmt.Errorf("invalid print handler. The expected signature is: "+
|
||||
"func handler(obj %v, w io.Writer, withNamespace bool, columnLabels []string) error", funcType.In(0))
|
||||
"func handler(obj %v, w io.Writer, withNamespace bool, wide bool, columnLabels []string) error", funcType.In(0))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -371,7 +377,7 @@ func translateTimestamp(timestamp util.Time) string {
|
||||
return shortHumanDuration(time.Now().Sub(timestamp.Time))
|
||||
}
|
||||
|
||||
func printPod(pod *api.Pod, w io.Writer, withNamespace bool, columnLabels []string) error {
|
||||
func printPod(pod *api.Pod, w io.Writer, withNamespace bool, wide bool, columnLabels []string) error {
|
||||
name := pod.Name
|
||||
if withNamespace {
|
||||
name = types.NamespacedName{Namespace: pod.Namespace, Name: pod.Name}.String()
|
||||
@@ -415,20 +421,30 @@ func printPod(pod *api.Pod, w io.Writer, withNamespace bool, columnLabels []stri
|
||||
); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if wide {
|
||||
nodeName := pod.Spec.NodeName
|
||||
if _, err := fmt.Fprintf(w, "\t%s",
|
||||
nodeName,
|
||||
); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
_, err := fmt.Fprint(w, appendLabels(pod.Labels, columnLabels))
|
||||
return err
|
||||
}
|
||||
|
||||
func printPodList(podList *api.PodList, w io.Writer, withNamespace bool, columnLabels []string) error {
|
||||
func printPodList(podList *api.PodList, w io.Writer, withNamespace bool, wide bool, columnLabels []string) error {
|
||||
for _, pod := range podList.Items {
|
||||
if err := printPod(&pod, w, withNamespace, columnLabels); err != nil {
|
||||
if err := printPod(&pod, w, withNamespace, wide, columnLabels); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func printPodTemplate(pod *api.PodTemplate, w io.Writer, withNamespace bool, columnLabels []string) error {
|
||||
func printPodTemplate(pod *api.PodTemplate, w io.Writer, withNamespace bool, wide bool, columnLabels []string) error {
|
||||
var name string
|
||||
if withNamespace {
|
||||
name = types.NamespacedName{pod.Namespace, pod.Name}.String()
|
||||
@@ -464,16 +480,16 @@ func printPodTemplate(pod *api.PodTemplate, w io.Writer, withNamespace bool, col
|
||||
return nil
|
||||
}
|
||||
|
||||
func printPodTemplateList(podList *api.PodTemplateList, w io.Writer, withNamespace bool, columnLabels []string) error {
|
||||
func printPodTemplateList(podList *api.PodTemplateList, w io.Writer, withNamespace bool, wide bool, columnLabels []string) error {
|
||||
for _, pod := range podList.Items {
|
||||
if err := printPodTemplate(&pod, w, withNamespace, columnLabels); err != nil {
|
||||
if err := printPodTemplate(&pod, w, withNamespace, wide, columnLabels); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func printReplicationController(controller *api.ReplicationController, w io.Writer, withNamespace bool, columnLabels []string) error {
|
||||
func printReplicationController(controller *api.ReplicationController, w io.Writer, withNamespace bool, wide bool, columnLabels []string) error {
|
||||
var name string
|
||||
if withNamespace {
|
||||
name = types.NamespacedName{controller.Namespace, controller.Name}.String()
|
||||
@@ -510,16 +526,16 @@ func printReplicationController(controller *api.ReplicationController, w io.Writ
|
||||
return nil
|
||||
}
|
||||
|
||||
func printReplicationControllerList(list *api.ReplicationControllerList, w io.Writer, withNamespace bool, columnLabels []string) error {
|
||||
func printReplicationControllerList(list *api.ReplicationControllerList, w io.Writer, withNamespace bool, wide bool, columnLabels []string) error {
|
||||
for _, controller := range list.Items {
|
||||
if err := printReplicationController(&controller, w, withNamespace, columnLabels); err != nil {
|
||||
if err := printReplicationController(&controller, w, withNamespace, wide, columnLabels); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func printService(svc *api.Service, w io.Writer, withNamespace bool, columnLabels []string) error {
|
||||
func printService(svc *api.Service, w io.Writer, withNamespace bool, wide bool, columnLabels []string) error {
|
||||
var name string
|
||||
if withNamespace {
|
||||
name = types.NamespacedName{svc.Namespace, svc.Name}.String()
|
||||
@@ -566,16 +582,16 @@ func printService(svc *api.Service, w io.Writer, withNamespace bool, columnLabel
|
||||
return nil
|
||||
}
|
||||
|
||||
func printServiceList(list *api.ServiceList, w io.Writer, withNamespace bool, columnLabels []string) error {
|
||||
func printServiceList(list *api.ServiceList, w io.Writer, withNamespace bool, wide bool, columnLabels []string) error {
|
||||
for _, svc := range list.Items {
|
||||
if err := printService(&svc, w, withNamespace, columnLabels); err != nil {
|
||||
if err := printService(&svc, w, withNamespace, wide, columnLabels); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func printEndpoints(endpoints *api.Endpoints, w io.Writer, withNamespace bool, columnLabels []string) error {
|
||||
func printEndpoints(endpoints *api.Endpoints, w io.Writer, withNamespace bool, wide bool, columnLabels []string) error {
|
||||
var name string
|
||||
if withNamespace {
|
||||
name = types.NamespacedName{endpoints.Namespace, endpoints.Name}.String()
|
||||
@@ -590,16 +606,16 @@ func printEndpoints(endpoints *api.Endpoints, w io.Writer, withNamespace bool, c
|
||||
return err
|
||||
}
|
||||
|
||||
func printEndpointsList(list *api.EndpointsList, w io.Writer, withNamespace bool, columnLabels []string) error {
|
||||
func printEndpointsList(list *api.EndpointsList, w io.Writer, withNamespace bool, wide bool, columnLabels []string) error {
|
||||
for _, item := range list.Items {
|
||||
if err := printEndpoints(&item, w, withNamespace, columnLabels); err != nil {
|
||||
if err := printEndpoints(&item, w, withNamespace, wide, columnLabels); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func printNamespace(item *api.Namespace, w io.Writer, withNamespace bool, columnLabels []string) error {
|
||||
func printNamespace(item *api.Namespace, w io.Writer, withNamespace bool, wide bool, columnLabels []string) error {
|
||||
if _, err := fmt.Fprintf(w, "%s\t%s\t%s\n", item.Name, formatLabels(item.Labels), item.Status.Phase); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -607,16 +623,16 @@ func printNamespace(item *api.Namespace, w io.Writer, withNamespace bool, column
|
||||
return err
|
||||
}
|
||||
|
||||
func printNamespaceList(list *api.NamespaceList, w io.Writer, withNamespace bool, columnLabels []string) error {
|
||||
func printNamespaceList(list *api.NamespaceList, w io.Writer, withNamespace bool, wide bool, columnLabels []string) error {
|
||||
for _, item := range list.Items {
|
||||
if err := printNamespace(&item, w, withNamespace, columnLabels); err != nil {
|
||||
if err := printNamespace(&item, w, withNamespace, wide, columnLabels); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func printSecret(item *api.Secret, w io.Writer, withNamespace bool, columnLabels []string) error {
|
||||
func printSecret(item *api.Secret, w io.Writer, withNamespace bool, wide bool, columnLabels []string) error {
|
||||
var name string
|
||||
if withNamespace {
|
||||
name = types.NamespacedName{item.Namespace, item.Name}.String()
|
||||
@@ -631,9 +647,9 @@ func printSecret(item *api.Secret, w io.Writer, withNamespace bool, columnLabels
|
||||
return err
|
||||
}
|
||||
|
||||
func printSecretList(list *api.SecretList, w io.Writer, withNamespace bool, columnLabels []string) error {
|
||||
func printSecretList(list *api.SecretList, w io.Writer, withNamespace bool, wide bool, columnLabels []string) error {
|
||||
for _, item := range list.Items {
|
||||
if err := printSecret(&item, w, withNamespace, columnLabels); err != nil {
|
||||
if err := printSecret(&item, w, withNamespace, wide, columnLabels); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -641,7 +657,7 @@ func printSecretList(list *api.SecretList, w io.Writer, withNamespace bool, colu
|
||||
return nil
|
||||
}
|
||||
|
||||
func printServiceAccount(item *api.ServiceAccount, w io.Writer, withNamespace bool, columnLabels []string) error {
|
||||
func printServiceAccount(item *api.ServiceAccount, w io.Writer, withNamespace bool, wide bool, columnLabels []string) error {
|
||||
var name string
|
||||
if withNamespace {
|
||||
name = types.NamespacedName{item.Namespace, item.Name}.String()
|
||||
@@ -656,9 +672,9 @@ func printServiceAccount(item *api.ServiceAccount, w io.Writer, withNamespace bo
|
||||
return err
|
||||
}
|
||||
|
||||
func printServiceAccountList(list *api.ServiceAccountList, w io.Writer, withNamespace bool, columnLabels []string) error {
|
||||
func printServiceAccountList(list *api.ServiceAccountList, w io.Writer, withNamespace bool, wide bool, columnLabels []string) error {
|
||||
for _, item := range list.Items {
|
||||
if err := printServiceAccount(&item, w, withNamespace, columnLabels); err != nil {
|
||||
if err := printServiceAccount(&item, w, withNamespace, wide, columnLabels); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -666,7 +682,7 @@ func printServiceAccountList(list *api.ServiceAccountList, w io.Writer, withName
|
||||
return nil
|
||||
}
|
||||
|
||||
func printNode(node *api.Node, w io.Writer, withNamespace bool, columnLabels []string) error {
|
||||
func printNode(node *api.Node, w io.Writer, withNamespace bool, wide bool, columnLabels []string) error {
|
||||
conditionMap := make(map[api.NodeConditionType]*api.NodeCondition)
|
||||
NodeAllConditions := []api.NodeConditionType{api.NodeReady}
|
||||
for i := range node.Status.Conditions {
|
||||
@@ -697,16 +713,16 @@ func printNode(node *api.Node, w io.Writer, withNamespace bool, columnLabels []s
|
||||
return err
|
||||
}
|
||||
|
||||
func printNodeList(list *api.NodeList, w io.Writer, withNamespace bool, columnLabels []string) error {
|
||||
func printNodeList(list *api.NodeList, w io.Writer, withNamespace bool, wide bool, columnLabels []string) error {
|
||||
for _, node := range list.Items {
|
||||
if err := printNode(&node, w, withNamespace, columnLabels); err != nil {
|
||||
if err := printNode(&node, w, withNamespace, wide, columnLabels); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func printPersistentVolume(pv *api.PersistentVolume, w io.Writer, withNamespace bool, columnLabels []string) error {
|
||||
func printPersistentVolume(pv *api.PersistentVolume, w io.Writer, withNamespace bool, wide bool, columnLabels []string) error {
|
||||
var name string
|
||||
if withNamespace {
|
||||
name = types.NamespacedName{pv.Namespace, pv.Name}.String()
|
||||
@@ -733,16 +749,16 @@ func printPersistentVolume(pv *api.PersistentVolume, w io.Writer, withNamespace
|
||||
return err
|
||||
}
|
||||
|
||||
func printPersistentVolumeList(list *api.PersistentVolumeList, w io.Writer, withNamespace bool, columnLabels []string) error {
|
||||
func printPersistentVolumeList(list *api.PersistentVolumeList, w io.Writer, withNamespace bool, wide bool, columnLabels []string) error {
|
||||
for _, pv := range list.Items {
|
||||
if err := printPersistentVolume(&pv, w, withNamespace, columnLabels); err != nil {
|
||||
if err := printPersistentVolume(&pv, w, withNamespace, wide, columnLabels); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func printPersistentVolumeClaim(pvc *api.PersistentVolumeClaim, w io.Writer, withNamespace bool, columnLabels []string) error {
|
||||
func printPersistentVolumeClaim(pvc *api.PersistentVolumeClaim, w io.Writer, withNamespace bool, wide bool, columnLabels []string) error {
|
||||
var name string
|
||||
if withNamespace {
|
||||
name = types.NamespacedName{pvc.Namespace, pvc.Name}.String()
|
||||
@@ -757,16 +773,16 @@ func printPersistentVolumeClaim(pvc *api.PersistentVolumeClaim, w io.Writer, wit
|
||||
return err
|
||||
}
|
||||
|
||||
func printPersistentVolumeClaimList(list *api.PersistentVolumeClaimList, w io.Writer, withNamespace bool, columnLabels []string) error {
|
||||
func printPersistentVolumeClaimList(list *api.PersistentVolumeClaimList, w io.Writer, withNamespace bool, wide bool, columnLabels []string) error {
|
||||
for _, psd := range list.Items {
|
||||
if err := printPersistentVolumeClaim(&psd, w, withNamespace, columnLabels); err != nil {
|
||||
if err := printPersistentVolumeClaim(&psd, w, withNamespace, wide, columnLabels); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func printEvent(event *api.Event, w io.Writer, withNamespace bool, columnLabels []string) error {
|
||||
func printEvent(event *api.Event, w io.Writer, withNamespace bool, wide bool, columnLabels []string) error {
|
||||
if _, err := fmt.Fprintf(
|
||||
w, "%s\t%s\t%d\t%s\t%s\t%s\t%s\t%s\t%s",
|
||||
event.FirstTimestamp.Time.Format(time.RFC1123Z),
|
||||
@@ -786,17 +802,17 @@ func printEvent(event *api.Event, w io.Writer, withNamespace bool, columnLabels
|
||||
}
|
||||
|
||||
// Sorts and prints the EventList in a human-friendly format.
|
||||
func printEventList(list *api.EventList, w io.Writer, withNamespace bool, columnLabels []string) error {
|
||||
func printEventList(list *api.EventList, w io.Writer, withNamespace bool, wide bool, columnLabels []string) error {
|
||||
sort.Sort(SortableEvents(list.Items))
|
||||
for i := range list.Items {
|
||||
if err := printEvent(&list.Items[i], w, withNamespace, columnLabels); err != nil {
|
||||
if err := printEvent(&list.Items[i], w, withNamespace, wide, columnLabels); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func printLimitRange(limitRange *api.LimitRange, w io.Writer, withNamespace bool, columnLabels []string) error {
|
||||
func printLimitRange(limitRange *api.LimitRange, w io.Writer, withNamespace bool, wide bool, columnLabels []string) error {
|
||||
var name string
|
||||
if withNamespace {
|
||||
name = types.NamespacedName{limitRange.Namespace, limitRange.Name}.String()
|
||||
@@ -812,16 +828,16 @@ func printLimitRange(limitRange *api.LimitRange, w io.Writer, withNamespace bool
|
||||
}
|
||||
|
||||
// Prints the LimitRangeList in a human-friendly format.
|
||||
func printLimitRangeList(list *api.LimitRangeList, w io.Writer, withNamespace bool, columnLabels []string) error {
|
||||
func printLimitRangeList(list *api.LimitRangeList, w io.Writer, withNamespace bool, wide bool, columnLabels []string) error {
|
||||
for i := range list.Items {
|
||||
if err := printLimitRange(&list.Items[i], w, withNamespace, columnLabels); err != nil {
|
||||
if err := printLimitRange(&list.Items[i], w, withNamespace, wide, columnLabels); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func printResourceQuota(resourceQuota *api.ResourceQuota, w io.Writer, withNamespace bool, columnLabels []string) error {
|
||||
func printResourceQuota(resourceQuota *api.ResourceQuota, w io.Writer, withNamespace bool, wide bool, columnLabels []string) error {
|
||||
var name string
|
||||
if withNamespace {
|
||||
name = types.NamespacedName{resourceQuota.Namespace, resourceQuota.Name}.String()
|
||||
@@ -837,16 +853,16 @@ func printResourceQuota(resourceQuota *api.ResourceQuota, w io.Writer, withNames
|
||||
}
|
||||
|
||||
// Prints the ResourceQuotaList in a human-friendly format.
|
||||
func printResourceQuotaList(list *api.ResourceQuotaList, w io.Writer, withNamespace bool, columnLabels []string) error {
|
||||
func printResourceQuotaList(list *api.ResourceQuotaList, w io.Writer, withNamespace bool, wide bool, columnLabels []string) error {
|
||||
for i := range list.Items {
|
||||
if err := printResourceQuota(&list.Items[i], w, withNamespace, columnLabels); err != nil {
|
||||
if err := printResourceQuota(&list.Items[i], w, withNamespace, wide, columnLabels); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func printComponentStatus(item *api.ComponentStatus, w io.Writer, withNamespace bool, columnLabels []string) error {
|
||||
func printComponentStatus(item *api.ComponentStatus, w io.Writer, withNamespace bool, wide bool, columnLabels []string) error {
|
||||
status := "Unknown"
|
||||
message := ""
|
||||
error := ""
|
||||
@@ -870,9 +886,9 @@ func printComponentStatus(item *api.ComponentStatus, w io.Writer, withNamespace
|
||||
return err
|
||||
}
|
||||
|
||||
func printComponentStatusList(list *api.ComponentStatusList, w io.Writer, withNamespace bool, columnLabels []string) error {
|
||||
func printComponentStatusList(list *api.ComponentStatusList, w io.Writer, withNamespace bool, wide bool, columnLabels []string) error {
|
||||
for _, item := range list.Items {
|
||||
if err := printComponentStatus(&item, w, withNamespace, columnLabels); err != nil {
|
||||
if err := printComponentStatus(&item, w, withNamespace, wide, columnLabels); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -905,6 +921,16 @@ func formatLabelHeaders(columnLabels []string) []string {
|
||||
return formHead
|
||||
}
|
||||
|
||||
// headers for -o wide
|
||||
func formatWideHeaders(wide bool, t reflect.Type) []string {
|
||||
if wide {
|
||||
if t.String() == "*api.Pod" || t.String() == "*api.PodList" {
|
||||
return []string{"NODE"}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// PrintObj prints the obj in a human-friendly format according to the type of the obj.
|
||||
func (h *HumanReadablePrinter) PrintObj(obj runtime.Object, output io.Writer) error {
|
||||
w := tabwriter.NewWriter(output, 10, 4, 3, ' ', 0)
|
||||
@@ -912,11 +938,12 @@ func (h *HumanReadablePrinter) PrintObj(obj runtime.Object, output io.Writer) er
|
||||
t := reflect.TypeOf(obj)
|
||||
if handler := h.handlerMap[t]; handler != nil {
|
||||
if !h.noHeaders && t != h.lastType {
|
||||
headers := append(handler.columns, formatLabelHeaders(h.columnLabels)...)
|
||||
headers := append(handler.columns, formatWideHeaders(h.wide, t)...)
|
||||
headers = append(headers, formatLabelHeaders(h.columnLabels)...)
|
||||
h.printHeader(headers, w)
|
||||
h.lastType = t
|
||||
}
|
||||
args := []reflect.Value{reflect.ValueOf(obj), reflect.ValueOf(w), reflect.ValueOf(h.withNamespace), reflect.ValueOf(h.columnLabels)}
|
||||
args := []reflect.Value{reflect.ValueOf(obj), reflect.ValueOf(w), reflect.ValueOf(h.withNamespace), reflect.ValueOf(h.wide), reflect.ValueOf(h.columnLabels)}
|
||||
resultValue := handler.printFunc.Call(args)[0]
|
||||
if resultValue.IsNil() {
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user