package util
import "k8s.io/kubernetes/pkg/kubectl/cmd/util"
Index ¶
- func AddPrinterFlags(cmd *cobra.Command)
- func CheckErr(err error)
- func GetFlagBool(cmd *cobra.Command, flag string) bool
- func GetFlagDuration(cmd *cobra.Command, flag string) time.Duration
- func GetFlagInt(cmd *cobra.Command, flag string) int
- func GetFlagString(cmd *cobra.Command, flag string) string
- func Merge(dst runtime.Object, fragment, kind string) (runtime.Object, error)
- func OutputVersion(cmd *cobra.Command, defaultVersion string) string
- func PrinterForCommand(cmd *cobra.Command) (kubectl.ResourcePrinter, bool, error)
- func ReadConfigData(location string) ([]byte, error)
- func ReadConfigDataFromLocation(location string) ([]byte, error)
- func ReadConfigDataFromReader(reader io.Reader, source string) ([]byte, error)
- func ResourceFromArgs(cmd *cobra.Command, args []string, mapper meta.RESTMapper, cmdNamespace string) (mapping *meta.RESTMapping, namespace, name string, err error)
- func UsageError(cmd *cobra.Command, format string, args ...interface{}) error
Functions ¶
func AddPrinterFlags ¶
func CheckErr ¶
func CheckErr(err error)
func GetFlagBool ¶
func GetFlagDuration ¶
func GetFlagInt ¶
Assumes the flag has a default value.
func GetFlagString ¶
func Merge ¶
func OutputVersion ¶
OutputVersion returns the preferred output version for generic content (JSON, YAML, or templates)
func PrinterForCommand ¶
PrinterForCommand returns the default printer for this command. Requires that printer flags have been added to cmd (see AddPrinterFlags).
func ReadConfigData ¶
ReadConfigData reads the bytes from the specified filesytem or network location or from stdin if location == "-". TODO: replace with resource.Builder
func ReadConfigDataFromLocation ¶
TODO: replace with resource.Builder
func ReadConfigDataFromReader ¶
func ResourceFromArgs ¶
func ResourceFromArgs(cmd *cobra.Command, args []string, mapper meta.RESTMapper, cmdNamespace string) (mapping *meta.RESTMapping, namespace, name string, err error)
ResourceFromArgs expects two arguments with a given type, and extracts the fields necessary to uniquely locate a resource. Displays a UsageError if that contract is not satisfied, or a generic error if any other problems occur. DEPRECATED: Use resource.Builder
func UsageError ¶
Source Files ¶
helpers.go printing.go resource.go
- Version
- v0.14.0
- Published
- Mar 30, 2015
- Platform
- js/wasm
- Imports
- 19 packages
- Last checked
- 36 seconds ago –
Tools for package owners.