Documentation ¶
Index ¶
- func New(opts ...OptionFunc) corev1.Container
- type Builder
- func (b *Builder) AddCheck(p Predicate) *Builder
- func (b *Builder) AddChecks(p []Predicate) *Builder
- func (b *Builder) Build() (corev1.Container, error)
- func (b *Builder) WithArgumentsNew(args []string) *Builder
- func (b *Builder) WithCommandNew(cmd []string) *Builder
- func (b *Builder) WithEnvs(envs []corev1.EnvVar) *Builder
- func (b *Builder) WithEnvsNew(envs []corev1.EnvVar) *Builder
- func (b *Builder) WithImage(img string) *Builder
- func (b *Builder) WithImagePullPolicy(policy corev1.PullPolicy) *Builder
- func (b *Builder) WithLifeCycle(lc *corev1.Lifecycle) *Builder
- func (b *Builder) WithLivenessProbe(liveness *corev1.Probe) *Builder
- func (b *Builder) WithName(name string) *Builder
- func (b *Builder) WithPortsNew(ports []corev1.ContainerPort) *Builder
- func (b *Builder) WithPrivilegedSecurityContext(privileged *bool) *Builder
- func (b *Builder) WithResources(resources *corev1.ResourceRequirements) *Builder
- func (b *Builder) WithResourcesByValue(resources corev1.ResourceRequirements) *Builder
- func (b *Builder) WithVolumeDevices(volumeDevices []corev1.VolumeDevice) *Builder
- func (b *Builder) WithVolumeMountsNew(volumeMounts []corev1.VolumeMount) *Builder
- type OptionFunc
- type Predicate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder provides utilities required to build a kubernetes container type
func (*Builder) AddCheck ¶
AddCheck adds the predicate as a condition to be validated against the container instance
func (*Builder) AddChecks ¶
AddChecks adds the provided predicates as conditions to be validated against the container instance
func (*Builder) WithArgumentsNew ¶
WithArgumentsNew sets the command arguments of the container
func (*Builder) WithCommandNew ¶
WithCommandNew sets the command of the container
func (*Builder) WithEnvsNew ¶
WithEnvsNew sets the envs of the container
func (*Builder) WithImagePullPolicy ¶
func (b *Builder) WithImagePullPolicy(policy corev1.PullPolicy) *Builder
WithImagePullPolicy sets the image pull policy of the container
func (*Builder) WithLifeCycle ¶
WithLifeCycle sets the life cycle of the container
func (*Builder) WithLivenessProbe ¶
WithLivenessProbe sets the liveness probe of the container
func (*Builder) WithPortsNew ¶
func (b *Builder) WithPortsNew(ports []corev1.ContainerPort) *Builder
WithPortsNew sets ports of the container
func (*Builder) WithPrivilegedSecurityContext ¶
WithPrivilegedSecurityContext sets securitycontext of the container
func (*Builder) WithResources ¶
func (b *Builder) WithResources( resources *corev1.ResourceRequirements, ) *Builder
WithResources sets resources of the container
func (*Builder) WithResourcesByValue ¶
func (b *Builder) WithResourcesByValue(resources corev1.ResourceRequirements) *Builder
WithResourcesByValue sets resources of the container
func (*Builder) WithVolumeDevices ¶
func (b *Builder) WithVolumeDevices(volumeDevices []corev1.VolumeDevice) *Builder
WithVolumeDevices builds the containers with the appropriate volumeDevices
func (*Builder) WithVolumeMountsNew ¶
func (b *Builder) WithVolumeMountsNew(volumeMounts []corev1.VolumeMount) *Builder
WithVolumeMountsNew sets the command arguments of the container
type OptionFunc ¶
type OptionFunc func(*container)
OptionFunc is a typed function that abstracts anykind of operation against the provided container instance
This is the basic building block to create functional operations against the container instance
type Predicate ¶
Predicate abstracts conditional logic w.r.t the container instance
NOTE: Predicate is a functional approach versus traditional approach to mix conditions such as *if-else* within blocks of business logic
NOTE: Predicate approach enables clear separation of conditionals from imperatives i.e. actions that form the business logic