flags

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddBothBoolFlags

func AddBothBoolFlags(f *pflag.FlagSet, p *bool, name, short string, value bool, usage string)

AddBothBoolFlags adds the given flag in both `--foo` and `--no-foo` variants. If you do this, make sure you call ReconcileBoolFlags later to catch errors and set the relationship between the flag values. Only the flag that does the non-default behavior is visible; the other is hidden.

func AddBothBoolFlagsUnhidden

func AddBothBoolFlagsUnhidden(f *pflag.FlagSet, p *bool, name, short string, value bool, usage string)

AddBothBoolFlagsUnhidden is just like AddBothBoolFlags but shows both flags.

func FirstCharToLower added in v0.13.2

func FirstCharToLower(s string) string

FirstCharToLower converts first char in given string to lowercase

func InvertUsage added in v0.13.2

func InvertUsage(usage string) string

InvertUsage inverts the usage string with prefix "Do not"

func ReconcileBoolFlags

func ReconcileBoolFlags(f *pflag.FlagSet) error

ReconcileBoolFlags sets the value of the all the "--foo" flags based on "--no-foo" if provided, and returns an error if both were provided or an explicit value of false was provided to either (as that's confusing).

Types

type ChannelTypeFlags added in v0.17.0

type ChannelTypeFlags struct {
	// contains filtered or unexported fields
}

func (*ChannelTypeFlags) Add added in v0.17.0

func (i *ChannelTypeFlags) Add(f *pflag.FlagSet)

func (*ChannelTypeFlags) Parse added in v0.17.0

type PodSpecFlags added in v0.17.0

type PodSpecFlags struct {
	// Direct field manipulation
	Image   uniqueStringArg
	Env     []string
	EnvFrom []string
	Mount   []string
	Volume  []string

	Command string
	Arg     []string

	RequestsFlags, LimitsFlags ResourceFlags // TODO: Flag marked deprecated in release v0.15.0, remove in release v0.18.0
	Resources                  ResourceOptions
	Port                       string
	ServiceAccountName         string
	ImagePullSecrets           string
	User                       int64
}

PodSpecFlags to hold the container resource requirements values

func (*PodSpecFlags) AddFlags added in v0.17.0

func (p *PodSpecFlags) AddFlags(flagset *pflag.FlagSet) []string

AddFlags will add PodSpec related flags to FlagSet

type ResourceFlags added in v0.17.0

type ResourceFlags struct {
	CPU    string
	Memory string
}

type ResourceOptions added in v0.15.0

type ResourceOptions struct {
	Requests             []string
	Limits               []string
	ResourceRequirements corev1.ResourceRequirements
}

ResourceOptions to hold the container resource requirements values

func (*ResourceOptions) Validate added in v0.15.0

func (o *ResourceOptions) Validate() ([]string, []string, error)

Validate parses the limits and requests parameters if specified and sets ResourceRequirements for ResourceOptions or returns error if any

Jump to

Keyboard shortcuts

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