flags

package
v0.0.0-...-27d5cd9 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 13 Imported by: 1

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

func FirstCharToLower(s string) string

FirstCharToLower converts first char in given string to lowercase

func InvertUsage

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).

func UpdateContainerArg

func UpdateContainerArg(spec *corev1.PodSpec, arg []string) error

UpdateContainerArg updates container with a given argument

func UpdateContainerCommand

func UpdateContainerCommand(spec *corev1.PodSpec, command []string) error

UpdateContainerCommand updates container with a given argument

func UpdateContainerPort

func UpdateContainerPort(spec *corev1.PodSpec, port string) error

UpdateContainerPort updates container with a given name:port

func UpdateContainers

func UpdateContainers(spec *corev1.PodSpec, containers []corev1.Container)

UpdateContainers updates the containers array with additional ones provided from file or os.Stdin

func UpdateEnvFrom

func UpdateEnvFrom(spec *corev1.PodSpec, toUpdate []string, toRemove []string) error

UpdateEnvFrom updates envFrom

func UpdateEnvVars

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

func UpdateImage(spec *corev1.PodSpec, image string) error

UpdateImage a given image

func UpdateImagePullPolicy

func UpdateImagePullPolicy(spec *corev1.PodSpec, imagePullPolicy string) error

UpdateImagePullPolicy updates the pull policy for the given revision template

func UpdateImagePullSecrets

func UpdateImagePullSecrets(spec *corev1.PodSpec, pullsecrets string)

UpdateImagePullSecrets updates the image pull secrets used for the corresponding knative service

func UpdateLivenessProbe

func UpdateLivenessProbe(spec *corev1.PodSpec, probeString string) error

UpdateLivenessProbe updates container liveness probe based on provided string

func UpdateLivenessProbeOpts

func UpdateLivenessProbeOpts(spec *corev1.PodSpec, probeString string) error

UpdateLivenessProbeOpts updates container liveness probe commons options based on provided string

func UpdateReadinessProbe

func UpdateReadinessProbe(spec *corev1.PodSpec, probeString string) error

UpdateReadinessProbe updates container readiness probe based on provided string

func UpdateReadinessProbeOpts

func UpdateReadinessProbeOpts(spec *corev1.PodSpec, probeString string) error

UpdateReadinessProbeOpts updates container readiness probe commons options based on provided string

func UpdateResources

func UpdateResources(spec *corev1.PodSpec, resources corev1.ResourceRequirements, requestsToRemove, limitsToRemove []string) error

UpdateResources updates container resources for given revision spec

func UpdateServiceAccountName

func UpdateServiceAccountName(spec *corev1.PodSpec, serviceAccountName string)

UpdateServiceAccountName updates the service account name used for the corresponding knative service

func UpdateUser

func UpdateUser(spec *corev1.PodSpec, user int64) error

UpdateUser updates container with a given user id

func UpdateVolumeMountsAndVolumes

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 MountInfo

type MountInfo struct {
	VolumeName   string
	SubPath      string
	MountOptions string
}

type VolumeSourceType

type VolumeSourceType int

VolumeSourceType is a type standing for enumeration of ConfigMap and Secret

const (
	ConfigMapVolumeSourceType VolumeSourceType = iota
	SecretVolumeSourceType
	EmptyDirVolumeSourceType
	PVCVolumeSourceType
	PortFormatErr = "" /* 154-byte string literal not displayed */
)

Enumeration of volume source types: ConfigMap or Secret

func (VolumeSourceType) String

func (vt VolumeSourceType) String() string

Jump to

Keyboard shortcuts

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