flags

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2020 License: Apache-2.0 Imports: 8 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 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() (err 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