resources

package
v0.2.2-beta.4 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCreation = goerrors.New("error creating resource")

Functions

func ApplyOptionsToContainers

func ApplyOptionsToContainers(
	containers []corev1.Container,
	options ...ContainerOption,
) []corev1.Container

func PerformFinalizer

func PerformFinalizer[T FinalizerObject](ctx context.Context, t T, finalizerId string, finalizer func(ctx context.Context, t T) error) (bool, error)

func ReconcileChildResource

func ReconcileChildResource[T client.Object](ctx context.Context, c client.Client, desired client.Object, owner client.Object, scheme *runtime.Scheme, reconciler ReconcileFunc[T]) error

Types

type ContainerOption

type ContainerOption = func(*corev1.Container)

func ContainerWithAdditionalArgs

func ContainerWithAdditionalArgs(args ...string) ContainerOption

func ContainerWithAdditionalEnvVars

func ContainerWithAdditionalEnvVars(envs ...corev1.EnvVar) ContainerOption

func ContainerWithAdditionalVolumeMounts

func ContainerWithAdditionalVolumeMounts(mounts ...corev1.VolumeMount) ContainerOption

func ContainerWithPodSecurityStandardRestricted

func ContainerWithPodSecurityStandardRestricted() ContainerOption

func ContainerWithWorkingDir

func ContainerWithWorkingDir(dir string) ContainerOption

type ContainerRunRequest

type ContainerRunRequest struct {
	Spec corev1.Container `json:"spec,omitempty" description:"Container specification"`
	// Volumes is a list of volumes to add to the pod.
	Volumes []corev1.Volume `json:"volumes,omitempty" description:"A list of volumes to add to the pod."`
}

type FinalizerObject

type FinalizerObject interface {

	// GetObjectKind returns the ObjectKind of the object.
	// from [k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta]
	GetObjectKind() schema.ObjectKind

	// GetName returns the name of the object.
	// From [k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta]
	GetName() string

	// GetDeletionTimestamp returns the deletion timestamp
	// if the object has been deleted. If the object hasn't been
	// deleted, nil is returned.
	// From [k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta]
	GetDeletionTimestamp() *v1.Time

	// GetFinalizers returns the finalizers of the object.
	// From [k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta]
	GetFinalizers() []string

	// SetFinalizers sets the finalizers of the object.
	// From [k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta]
	SetFinalizers(finalizers []string)
}

type ReconcileFunc

type ReconcileFunc[T client.Object] func(ctx context.Context, c client.Client, actual, desired T) error

Jump to

Keyboard shortcuts

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