container

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadFromDeployment

func LoadFromDeployment(deployment *appsv1.Deployment) map[string]Container

func UpdateSecurityContext

func UpdateSecurityContext(c *corev1.Container, sc SecurityContext)

UpdateSecurityContext will update the security context of passed in container

Types

type Container

type Container struct {
	*corev1.Container
}

func LoadFromFile

func LoadFromFile(file string) (*Container, error)

func New

func New(container *corev1.Container) *Container

func (*Container) AppendConfigMapFromSourceIfMissing

func (c *Container) AppendConfigMapFromSourceIfMissing(name string)

func (*Container) AppendEnvIfMissing

func (c *Container) AppendEnvIfMissing(name, value string)

func (*Container) AppendEnvIfMissingOverrideIfPresent

func (c *Container) AppendEnvIfMissingOverrideIfPresent(name, value string)

func (*Container) AppendEnvStructIfMissing

func (c *Container) AppendEnvStructIfMissing(envVar corev1.EnvVar)

func (*Container) AppendEnvVarValueFromIfMissing

func (c *Container) AppendEnvVarValueFromIfMissing(name string, valueFrom *corev1.EnvVarSource)

func (*Container) AppendVolumeMountIfMissing

func (c *Container) AppendVolumeMountIfMissing(name, mountPath string)

func (*Container) AppendVolumeMountStructIfMissing

func (c *Container) AppendVolumeMountStructIfMissing(volumeMount corev1.VolumeMount)

func (*Container) AppendVolumeMountWithSubPath

func (c *Container) AppendVolumeMountWithSubPath(name, mountPath, subPath string)

func (*Container) AppendVolumeMountWithSubPathIfMissing

func (c *Container) AppendVolumeMountWithSubPathIfMissing(name, mountPath, subPath string)

func (*Container) DeleteEnv

func (c *Container) DeleteEnv(name string)

func (*Container) GetEnvs

func (c *Container) GetEnvs(reqs []string) []corev1.EnvVar

func (*Container) SetArgs

func (c *Container) SetArgs(args []string)

func (*Container) SetCommand

func (c *Container) SetCommand(command []string)

func (*Container) SetImage

func (c *Container) SetImage(img, tag string)

func (*Container) SetLivenessProbe

func (c *Container) SetLivenessProbe(probe *corev1.Probe)

func (*Container) SetReadinessProbe

func (c *Container) SetReadinessProbe(probe *corev1.Probe)

func (*Container) SetStartupProbe

func (c *Container) SetStartupProbe(probe *corev1.Probe)

func (*Container) SetVolumeMounts

func (c *Container) SetVolumeMounts(volumeMounts []corev1.VolumeMount)

func (*Container) UpdateEnv

func (c *Container) UpdateEnv(name, value string)

func (*Container) UpdateResources

func (c *Container) UpdateResources(new *corev1.ResourceRequirements) error

func (*Container) UpdateSecurityContext

func (c *Container) UpdateSecurityContext(sc SecurityContext)

UpdateSecurityContext will update the security context of the container

type SecurityContext

type SecurityContext struct {
	Privileged               *bool
	RunAsNonRoot             *bool
	RunAsUser                *int64
	AllowPrivilegeEscalation *bool
}

Jump to

Keyboard shortcuts

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