cmd

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 8, 2020 License: GPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Directories        = []string{}
	StandaloneLintMode bool
	Fix                bool
	OutPath            string
	Report             bool
)
View Source
var RootCmd = &cobra.Command{
	Use:   "k8sutil",
	Short: "Command-line utility for working with kubernetes resources",
}

Functions

func AggregateFiles

func AggregateFiles(args []string, directories []string) ([]string, error)

copied and pasted directly from kubeval/main.go. I realy just needed to process the command line arguments and send them off. Is this plagiarism

func Convert

func Convert(resource runtime.Object, b []byte, fileName string) (*utils.ResourceInfo, error)

func Execute

func Execute()

Execute is called by main.main(). It only needs to happen once to the rootCmd.

func GetConfigPath

func GetConfigPath() (string, bool)

func GetFiles

func GetFiles(filenames []string, args []string) ([]*os.File, error)

func GetResourcesGroupedByKind

func GetResourcesGroupedByKind(resources []*utils.ResourceInfo) map[string][]*utils.ResourceInfo

func GetResourcesGroupedByLabel

func GetResourcesGroupedByLabel(resources []*utils.ResourceInfo) map[string][]*utils.ResourceInfo

func MakeResourceInformation

func MakeResourceInformation(b []byte, fileName string) (*utils.ResourceInfo, error)

func PrintDefault

func PrintDefault(resources []*utils.ResourceInfo)

func PrintDependencyInformation

func PrintDependencyInformation(dependencies []*utils.DependencyInformation)

func PrintFilteredByKind

func PrintFilteredByKind(resources []*utils.ResourceInfo, kind string)

func PrintGroupByKind

func PrintGroupByKind(resources []*utils.ResourceInfo)

func PrintGroupByLabel

func PrintGroupByLabel(resources []*utils.ResourceInfo)

func PrintLabels

func PrintLabels(labels map[string][]string)

func ReportFixes

func ReportFixes(errorFixes []string)

func StripAndWriteToBytesSlice

func StripAndWriteToBytesSlice(s *json.Serializer, o runtime.Object) ([]byte, error)

Remove unnecessary fields from the runtime Object so that we don't accidentally get fields that are empty becoming marshalled. One example is that creationTimestamp: null always appears because apparently encoding/json cannot handle the empty struct and prints null anyway. Very annoying.

Types

type Colour

type Colour func(...interface{}) string

type Selection

type Selection struct {
	Context   string
	Namespace string
}

Jump to

Keyboard shortcuts

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