Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultTableColumns = []TableColumn{ { TableColumnDefinition: metav1.TableColumnDefinition{ Name: "Name", Type: "string", Format: "name", }, Extract: func(rev history.Revision) any { return rev.Name() }, }, { TableColumnDefinition: metav1.TableColumnDefinition{ Name: "Revision", Type: "integer", }, Extract: func(rev history.Revision) any { return rev.Number() }, }, { TableColumnDefinition: metav1.TableColumnDefinition{ Name: "Ready", Type: "string", }, Extract: func(rev history.Revision) any { return fmt.Sprintf("%d/%d", rev.ReadyReplicas(), rev.CurrentReplicas()) }, }, { TableColumnDefinition: metav1.TableColumnDefinition{ Name: "Age", Type: "string", }, Extract: func(rev history.Revision) any { return table.ConvertToHumanReadableDateType(rev.Object().GetCreationTimestamp()) }, }, { TableColumnDefinition: metav1.TableColumnDefinition{ Name: "Containers", Type: "string", Priority: 1, }, Extract: func(rev history.Revision) any { var names []string for _, container := range rev.PodTemplate().Spec.Containers { names = append(names, container.Name) } return strings.Join(names, ",") }, }, { TableColumnDefinition: metav1.TableColumnDefinition{ Name: "Images", Type: "string", Priority: 1, }, Extract: func(rev history.Revision) any { var images []string for _, container := range rev.PodTemplate().Spec.Containers { images = append(images, container.Image) } return strings.Join(images, ",") }, }, }
DefaultTableColumns is the list of default column definitions.
Functions ¶
Types ¶
type RevisionPrinter ¶
type RevisionPrinter struct { Delegate printers.ResourcePrinter TemplateOnly bool }
RevisionPrinter prints revisions' objects or pod templates using the given delegate printer.
type RevisionsToTablePrinter ¶
type RevisionsToTablePrinter struct { Delegate printers.ResourcePrinter // Columns is the list of columns that should be printed. Columns []TableColumn }
RevisionsToTablePrinter transforms revision objects to a metav1.Table and passes it on to the delegate (table) printer.
type TableColumn ¶
type TableColumn struct { metav1.TableColumnDefinition Extract func(rev history.Revision) any }
TableColumn represents a single column with a header and logic for extracting a revision's cell value.
Click to show internal directories.
Click to hide internal directories.