Documentation ¶
Index ¶
- Constants
- Variables
- func AllSupportedArchitecturesSet() sets.Set[string]
- func ApplyResource(ctx context.Context, clientSet *kubernetes.Clientset, ...) (client.Object, bool, error)
- func ApplyResources(ctx context.Context, clientSet *kubernetes.Clientset, ...) error
- func ArchLabelValue(arch string) string
- func Buckets() []float64
- func DeleteResource(ctx context.Context, namespacedTypedClient DeleterInterface, objName string) error
- func DeleteResources(ctx context.Context, toDeleteRefs []ToDeleteRef) error
- func ExtractAuthFromSecret(secret *v1.Secret) ([]byte, error)
- func HistogramObserve(initialTime time.Time, histogram prometheus.Histogram)
- func Image() string
- func IsResourceAvailable(ctx context.Context, client *dynamic.DynamicClient, ...) bool
- func Namespace() string
- func NewPtr[T any](a T) *T
- type DeleterInterface
- type ToDeleteRef
Constants ¶
const ( ControllerNameKey = "controller" OperandLabelKey = "multiarch.openshift.io/operand" OperatorName = "multiarch-tuning-operator" )
const ( ArchitectureAmd64 = "amd64" ArchitectureArm64 = "arm64" ArchitecturePpc64le = "ppc64le" ArchitectureS390x = "s390x" )
const ( ArchLabel = "kubernetes.io/arch" NodeAffinityLabel = "multiarch.openshift.io/node-affinity" NodeAffinityLabelValueSet = "set" LabelValueNotSet = "not-set" HostnameLabel = "kubernetes.io/hostname" SchedulingGateLabel = "multiarch.openshift.io/scheduling-gate" SchedulingGateLabelValueGated = "gated" SchedulingGateLabelValueRemoved = "removed" PodPlacementFinalizerName = "finalizers.multiarch.openshift.io/pod-placement" SingleArchLabel = "multiarch.openshift.io/single-arch" MultiArchLabel = "multiarch.openshift.io/multi-arch" NoSupportedArchLabel = "multiarch.openshift.io/no-supported-arch" ImageInspectionErrorLabel = "multiarch.openshift.io/image-inspect-error" ImageInspectionErrorCountLabel = "multiarch.openshift.io/image-inspect-error-count" LabelGroup = "multiarch.openshift.io" )
const ( // SchedulingGateName is the name of the Scheduling Gate SchedulingGateName = "multiarch.openshift.io/scheduling-gate" MasterNodeSelectorLabel = "node-role.kubernetes.io/master" ControlPlaneNodeSelectorLabel = "node-role.kubernetes.io/control-plane" )
const ( PodMutatingWebhookConfigurationName = "pod-placement-mutating-webhook-configuration" PodMutatingWebhookName = "pod-placement-scheduling-gate.multiarch.openshift.io" PodPlacementControllerName = "pod-placement-controller" PodPlacementWebhookName = "pod-placement-web-hook" )
Variables ¶
var AtomicLevel zap.AtomicLevel = zap.NewAtomicLevelAt(-5)
Functions ¶
func ApplyResource ¶
func ApplyResource(ctx context.Context, clientSet *kubernetes.Clientset, client *dynamic.DynamicClient, 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, client *dynamic.DynamicClient, 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 ArchLabelValue ¶
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 HistogramObserve ¶
func HistogramObserve(initialTime time.Time, histogram prometheus.Histogram)
func IsResourceAvailable ¶
func IsResourceAvailable(ctx context.Context, client *dynamic.DynamicClient, resource schema.GroupVersionResource) bool
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
func NewDynamicDeleter ¶
func NewDynamicDeleter(dynamicClient dynamic.ResourceInterface) DeleterInterface
type ToDeleteRef ¶
type ToDeleteRef struct { NamespacedTypedClient DeleterInterface ObjName string }