utils

package
v0.0.0-...-51b2d08 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ControllerNameKey = "controller"
	OperandLabelKey   = "multiarch.openshift.io/operand"
	OperatorName      = "multiarch-tuning-operator"
)
View Source
const (
	ArchitectureAmd64   = "amd64"
	ArchitectureArm64   = "arm64"
	ArchitecturePpc64le = "ppc64le"
	ArchitectureS390x   = "s390x"
)
View Source
const (
	ArchLabel                       = "kubernetes.io/arch"
	NodeAffinityLabel               = "multiarch.openshift.io/node-affinity"
	NodeAffinityLabelValueSet       = "set"
	NodeAffinityLabelValueNotSet    = "not-set"
	HostnameLabel                   = "kubernetes.io/hostname"
	SchedulingGateLabel             = "multiarch.openshift.io/scheduling-gate"
	SchedulingGateLabelValueGated   = "gated"
	SchedulingGateLabelValueRemoved = "removed"
)

Variables

This section is empty.

Functions

func ApplyResource

func ApplyResource(ctx context.Context, clientSet *kubernetes.Clientset, recorder events.Recorder,
	obj client.Object) (client.Object, bool, error)

ApplyResource applies the given object to the cluster. It returns the object as it is in the cluster, a boolean indicating if the object was created or updated and an error if any. TODO[integration-tests]: integration tests for this function in a suite dedicated to this package

func ApplyResources

func ApplyResources(ctx context.Context, clientSet *kubernetes.Clientset, recorder events.Recorder,
	objs []client.Object) error

ApplyResources applies the given objects to the cluster. It returns an error if any. TODO[integration-tests]: integration tests for this function in a suite dedicated to this package

func DeleteResource

func DeleteResource(ctx context.Context, namespacedTypedClient DeleterInterface, objName string) error

DeleteResource deletes the given object from the cluster. It returns an error if any. TODO[integration-tests]: integration tests for this function in a suite dedicated to this package

func DeleteResources

func DeleteResources(ctx context.Context, toDeleteRefs []ToDeleteRef) error

DeleteResources deletes the given objects from the cluster. It returns an error if any. TODO[integration-tests]: integration tests for this function in a suite dedicated to this package

func ExtractAuthFromSecret

func ExtractAuthFromSecret(secret *v1.Secret) ([]byte, error)

func Image

func Image() string

Image returns the image used to run the operator.

func Namespace

func Namespace() string

Namespace returns the namespace where the operator's pods are running.

func NewPtr

func NewPtr[T any](a T) *T

Types

type DeleterInterface

type DeleterInterface interface {
	Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
}

DeleterInterface abstracts the Delete method of a typed and namespaced client got from a clientset

type ToDeleteRef

type ToDeleteRef struct {
	NamespacedTypedClient DeleterInterface
	ObjName               string
}

Jump to

Keyboard shortcuts

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