constructors

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package constructors provides functions to prepare new objects (as described by the name of the function) This implements factory pattern.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPVCToPod

func AddPVCToPod(pod *apiv1.Pod, pvc *apiv1.PersistentVolumeClaim)

AddPVCToPod adds a PersistentVolumeClaim to a Pod

func CapabilityObjectList

func CapabilityObjectList(capList []string) []apiv1.Capability

CapabilityObjectList converts a list of strings into a list of capability objects

func DefaultContainerSecurityContext

func DefaultContainerSecurityContext() *apiv1.SecurityContext

DefaultContainerSecurityContext returns an SC with the drop capabilities specified in config vars

func DefaultEntrypoint

func DefaultEntrypoint() []string

DefaultEntrypoint is used by all default pods

func DefaultPodSecurityContext

func DefaultPodSecurityContext() *apiv1.PodSecurityContext

DefaultPodSecurityContext returns a basic PSC

func DynamicPersistentVolumeClaim

func DynamicPersistentVolumeClaim(baseName, namespace, storageClass string) *apiv1.PersistentVolumeClaim

DynamicPersistentVolumeClaim constructs a simple Dynamic PersistentVolumeClaim

func PodSpec

func PodSpec(baseName, namespace, image string) *apiv1.Pod

PodSpec constructs a simple pod object

Types

type PersistentVolumeClaimConfig

type PersistentVolumeClaimConfig struct {
	Name       string // Name of the PVC. If set, overrides NamePrefix
	NamePrefix string // NamePrefix defaults to "pvc-" if unspecified
	ClaimSize  string // ClaimSize must be specified in the Quantity format. Defaults to 2Gi if unspecified

	AccessModes      []apiv1.PersistentVolumeAccessMode // AccessModes defaults to RWO if unspecified
	Annotations      map[string]string
	Selector         *metav1.LabelSelector
	StorageClassName *string

	VolumeMode *apiv1.PersistentVolumeMode // VolumeMode defaults to nil if unspecified or specified as the empty string
}

PersistentVolumeClaimConfig holds the state of the PVC

Jump to

Keyboard shortcuts

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