Documentation
¶
Index ¶
- func AddBothBoolFlags(f *pflag.FlagSet, p *bool, name, short string, value bool, usage string)
- func AddBothBoolFlagsUnhidden(f *pflag.FlagSet, p *bool, name, short string, value bool, usage string)
- func FirstCharToLower(s string) string
- func InvertUsage(usage string) string
- func ReconcileBoolFlags(f *pflag.FlagSet) error
- func UpdateContainerArg(spec *corev1.PodSpec, arg []string) error
- func UpdateContainerCommand(spec *corev1.PodSpec, command []string) error
- func UpdateContainerPort(spec *corev1.PodSpec, port string) error
- func UpdateContainers(spec *corev1.PodSpec, containers []corev1.Container)
- func UpdateEnvFrom(spec *corev1.PodSpec, toUpdate []string, toRemove []string) error
- func UpdateEnvVars(spec *corev1.PodSpec, allArgs []string, envToUpdate *util.OrderedMap, ...) error
- func UpdateImage(spec *corev1.PodSpec, image string) error
- func UpdateImagePullSecrets(spec *corev1.PodSpec, pullsecrets string)
- func UpdateResources(spec *corev1.PodSpec, resources corev1.ResourceRequirements, ...) error
- func UpdateServiceAccountName(spec *corev1.PodSpec, serviceAccountName string)
- func UpdateUser(spec *corev1.PodSpec, user int64) error
- func UpdateVolumeMountsAndVolumes(spec *corev1.PodSpec, mountsToUpdate *util.OrderedMap, mountsToRemove []string, ...) error
- type ChannelRef
- type ChannelTypeFlags
- type PodSpecFlags
- func (p *PodSpecFlags) AddCreateFlags(flagset *pflag.FlagSet) []string
- func (p *PodSpecFlags) AddFlags(flagset *pflag.FlagSet) []string
- func (p *PodSpecFlags) AddUpdateFlags(flagset *pflag.FlagSet) []string
- func (p *PodSpecFlags) ResolvePodSpec(podSpec *corev1.PodSpec, flags *pflag.FlagSet, allArgs []string) error
- type ResourceFlags
- type ResourceOptions
- type VolumeSourceType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddBothBoolFlags ¶
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
FirstCharToLower converts first char in given string to lowercase
func InvertUsage ¶ added in v0.13.2
InvertUsage inverts the usage string with prefix "Do not"
func ReconcileBoolFlags ¶
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).
func UpdateContainerArg ¶ added in v0.19.0
UpdateContainerArg updates container with a given argument
func UpdateContainerCommand ¶ added in v0.19.0
UpdateContainerCommand updates container with a given argument
func UpdateContainerPort ¶ added in v0.19.0
UpdateContainerPort updates container with a given name:port
func UpdateContainers ¶ added in v0.25.0
UpdateContainers updates the containers array with additional ones provided from file or os.Stdin
func UpdateEnvFrom ¶ added in v0.19.0
UpdateEnvFrom updates envFrom
func UpdateEnvVars ¶ added in v0.19.0
func UpdateEnvVars(spec *corev1.PodSpec, allArgs []string, envToUpdate *util.OrderedMap, envToRemove []string, envValueFromToUpdate *util.OrderedMap, envValueFromToRemove []string, envFileName string, envValueFileToUpdate *util.OrderedMap, envValueFileToRemove []string, ) error
UpdateEnvVars gives the configuration all the env var values listed in the given map of vars. Does not touch any environment variables not mentioned, but it can add new env vars and change the values of existing ones.
func UpdateImage ¶ added in v0.19.0
UpdateImage a given image
func UpdateImagePullSecrets ¶ added in v0.19.0
UpdateImagePullSecrets updates the image pull secrets used for the corresponding knative service
func UpdateResources ¶ added in v0.19.0
func UpdateResources(spec *corev1.PodSpec, resources corev1.ResourceRequirements, requestsToRemove, limitsToRemove []string) error
UpdateResources updates container resources for given revision spec
func UpdateServiceAccountName ¶ added in v0.19.0
UpdateServiceAccountName updates the service account name used for the corresponding knative service
func UpdateUser ¶ added in v0.19.0
UpdateUser updates container with a given user id
func UpdateVolumeMountsAndVolumes ¶ added in v0.19.0
func UpdateVolumeMountsAndVolumes(spec *corev1.PodSpec, mountsToUpdate *util.OrderedMap, mountsToRemove []string, volumesToUpdate *util.OrderedMap, volumesToRemove []string) error
UpdateVolumeMountsAndVolumes updates the configuration for volume mounts and volumes.
Types ¶
type ChannelRef ¶ added in v0.17.1
type ChannelRef struct {
Cref string
}
func (*ChannelRef) Add ¶ added in v0.17.1
func (i *ChannelRef) Add(f *pflag.FlagSet)
Add sets channel reference flag definition to given flagset
func (*ChannelRef) Parse ¶ added in v0.17.1
func (i *ChannelRef) Parse() (*duckv1.KReference, error)
Parse parses the CLI value for channel ref flag and populates object reference or return error
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)
Add sets channel type flag definition to given flagset
func (*ChannelTypeFlags) Parse ¶ added in v0.17.0
func (i *ChannelTypeFlags) Parse() (*schema.GroupVersionKind, error)
Parse parses the CLI value for channel type flag and populates GVK or returns error
type PodSpecFlags ¶ added in v0.17.0
type PodSpecFlags struct { // Direct field manipulation Image uniqueStringArg Env []string EnvFrom []string EnvValueFrom []string EnvFile string Mount []string Volume []string Command []string Arg []string ExtraContainers string Resources ResourceOptions Port string ServiceAccountName string ImagePullSecrets string User int64 }
PodSpecFlags to hold the container resource requirements values
func (*PodSpecFlags) AddCreateFlags ¶ added in v0.28.0
func (p *PodSpecFlags) AddCreateFlags(flagset *pflag.FlagSet) []string
AddCreateFlags will add PodSpec flags related to environment variable to FlagSet of create command
func (*PodSpecFlags) AddFlags ¶ added in v0.17.0
func (p *PodSpecFlags) AddFlags(flagset *pflag.FlagSet) []string
AddFlags will add PodSpec related flags to FlagSet
func (*PodSpecFlags) AddUpdateFlags ¶ added in v0.28.0
func (p *PodSpecFlags) AddUpdateFlags(flagset *pflag.FlagSet) []string
AddUpdateFlags will add PodSpec flags related to environment variable to FlagSet of update command
func (*PodSpecFlags) ResolvePodSpec ¶ added in v0.19.0
func (p *PodSpecFlags) ResolvePodSpec(podSpec *corev1.PodSpec, flags *pflag.FlagSet, allArgs []string) error
ResolvePodSpec will create corev1.PodSpec based on the flag inputs and all input arguments
type ResourceFlags ¶ added in v0.17.0
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
type VolumeSourceType ¶ added in v0.19.0
type VolumeSourceType int
VolumeSourceType is a type standing for enumeration of ConfigMap and Secret
const ( ConfigMapVolumeSourceType VolumeSourceType = iota SecretVolumeSourceType PortFormatErr = "" /* 154-byte string literal not displayed */ )
Enumeration of volume source types: ConfigMap or Secret
func (VolumeSourceType) String ¶ added in v0.19.0
func (vt VolumeSourceType) String() string