securitycontextconstraints

package
v0.0.0-...-81cd6e7 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateOrUpdate

CreateOrUpdate attempts first to get the given securitycontextconstraints. If the securitycontextconstraints does not exist, the securitycontextconstraints will be created. Otherwise, if the securitycontextconstraints exists and the provided comparison func detects any changes an update is attempted. Updates are retried with backoff (See retry.DefaultRetry). Returns on failure an non-nil error.

func Equal

func Equal(current, desired *securityv1.SecurityContextConstraints) bool

Equal return only true if the securitycontextconstraints are equal

func Mutate

func Mutate(current, desired *securityv1.SecurityContextConstraints)

Mutate is a default mutate functions for securitycontextconstraints. It overrides the values used by the cluster to maintain security.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

Builder represents the struct to build security context constraints

func New

func New(name string, allowPrivelegeContainer, allowHostDirVolumePlugin, readOnlyRootFilesystem bool) *Builder

New returns a new Builder for security context constraints

func (*Builder) Build

Build returns the final security context constraints

func (*Builder) WithAllowPrivilegeEscalation

func (b *Builder) WithAllowPrivilegeEscalation(value bool) *Builder

Sets the constraints privelege escalation

func (*Builder) WithDefaultAllowPrivilegeEscalation

func (b *Builder) WithDefaultAllowPrivilegeEscalation(value bool) *Builder

Sets the constraints default privelege escalation

func (*Builder) WithForbiddenSysctls

func (b *Builder) WithForbiddenSysctls(forbiddenSysctls []string) *Builder

Sets the constraints forbidden sysctls

func (*Builder) WithRequiredDropCapabilities

func (b *Builder) WithRequiredDropCapabilities(capabilities []corev1.Capability) *Builder

Sets the constraints drop capabilities

func (*Builder) WithRunAsUserOptions

func (b *Builder) WithRunAsUserOptions(options securityv1.RunAsUserStrategyOptions) *Builder

Sets the constraints user options

func (*Builder) WithSELinuxContextOptions

func (b *Builder) WithSELinuxContextOptions(options securityv1.SELinuxContextStrategyOptions) *Builder

Sets the constraints selinuxcontext options

func (*Builder) WithVolumes

func (b *Builder) WithVolumes(volumes []securityv1.FSType) *Builder

Sets the constraints volumes

type EqualityFunc

type EqualityFunc func(current, desired *securityv1.SecurityContextConstraints) bool

EqualityFunc is the type for functions that compare two ecuritycontextconstraints. Return true if two ecuritycontextconstraints are equal.

type MutateFunc

type MutateFunc func(current, desired *securityv1.SecurityContextConstraints)

MutateFunc is the type for functions that mutate the current securitycontextconstraints by applying the values from the desired route.

Jump to

Keyboard shortcuts

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