mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 06:54:01 +00:00
clean unused functions in ./pkg/printers/internalversion/printers.go
This commit is contained in:
parent
8616687c90
commit
462b4e190d
@ -19,7 +19,6 @@ package internalversion
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
|
||||||
"net"
|
"net"
|
||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
@ -1548,13 +1547,6 @@ func printComponentStatusList(list *api.ComponentStatusList, options printers.Pr
|
|||||||
return rows, nil
|
return rows, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func truncate(str string, maxLen int) string {
|
|
||||||
if len(str) > maxLen {
|
|
||||||
return str[0:maxLen] + "..."
|
|
||||||
}
|
|
||||||
return str
|
|
||||||
}
|
|
||||||
|
|
||||||
func printDeployment(obj *apps.Deployment, options printers.PrintOptions) ([]metav1beta1.TableRow, error) {
|
func printDeployment(obj *apps.Deployment, options printers.PrintOptions) ([]metav1beta1.TableRow, error) {
|
||||||
row := metav1beta1.TableRow{
|
row := metav1beta1.TableRow{
|
||||||
Object: runtime.RawExtension{Object: obj},
|
Object: runtime.RawExtension{Object: obj},
|
||||||
@ -1829,24 +1821,6 @@ func printStatus(obj *metav1.Status, options printers.PrintOptions) ([]metav1bet
|
|||||||
return []metav1beta1.TableRow{row}, nil
|
return []metav1beta1.TableRow{row}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Lay out all the containers on one line if use wide output.
|
|
||||||
// DEPRECATED: convert to TableHandler and use layoutContainerCells
|
|
||||||
func layoutContainers(containers []api.Container, w io.Writer) error {
|
|
||||||
var namesBuffer bytes.Buffer
|
|
||||||
var imagesBuffer bytes.Buffer
|
|
||||||
|
|
||||||
for i, container := range containers {
|
|
||||||
namesBuffer.WriteString(container.Name)
|
|
||||||
imagesBuffer.WriteString(container.Image)
|
|
||||||
if i != len(containers)-1 {
|
|
||||||
namesBuffer.WriteString(",")
|
|
||||||
imagesBuffer.WriteString(",")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_, err := fmt.Fprintf(w, "\t%s\t%s", namesBuffer.String(), imagesBuffer.String())
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// Lay out all the containers on one line if use wide output.
|
// Lay out all the containers on one line if use wide output.
|
||||||
func layoutContainerCells(containers []api.Container) (names string, images string) {
|
func layoutContainerCells(containers []api.Container) (names string, images string) {
|
||||||
var namesBuffer bytes.Buffer
|
var namesBuffer bytes.Buffer
|
||||||
|
Loading…
Reference in New Issue
Block a user