helpers

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2021 License: UPL-1.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NothingFound = "no resources found"
)

Variables

This section is empty.

Functions

func Age

func Age(createTime v1.Time) string

Age takes a Time and returns the length of time from then to now in a compact format like 2d3h

func FormatStringSlice

func FormatStringSlice(in []string) string

FormatStringSlice formats a string slice as a comma separated list

func PrintTable

func PrintTable(headings []string, data [][]string, w io.Writer) error

PrintTable will print the data in a well-formatted table with the headings at top

func ServerSideApply

func ServerSideApply(config *rest.Config, yaml string) error

Types

type Kubernetes added in v0.17.0

type Kubernetes interface {
	GetKubeConfig() *rest.Config
	NewClustersClientSet() (clientset.Interface, error)
	NewProjectClientSet() (projectclientset.Interface, error)
	NewVerrazzanoClientSet() (verrazzanoclientset.Interface, error)
	NewClientSet() kubernetes.Interface
}

type PrintFlags added in v0.17.0

type PrintFlags struct {
	JSONYamlPrintFlags *genericclioptions.JSONYamlPrintFlags
	TemplateFlags      *genericclioptions.KubeTemplatePrintFlags

	OutputFormat *string
}

PrintFlags contains all the flags used for output options

func NewGetPrintFlags added in v0.17.0

func NewGetPrintFlags() *PrintFlags

NewGetPrintFlags returns a new PrintFlags struct for use

func (*PrintFlags) AddFlags added in v0.17.0

func (f *PrintFlags) AddFlags(cmd *cobra.Command)

AddFlags binds all the required flags for output to the cmd

func (*PrintFlags) AllowedFormats added in v0.17.0

func (f *PrintFlags) AllowedFormats() []string

AllowedFormats is a list of all the allowed formats for output options

func (*PrintFlags) ToPrinter added in v0.17.0

func (f *PrintFlags) ToPrinter() (printers.ResourcePrinter, error)

ToPrinter returns an appropriate printer based on the output format or returns an error if there is none

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL