utils

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnnotateNode added in v1.3.0

func AnnotateNode(ctx context.Context, nodeName string, key, value string, c client.Client) error

AnnotateNode add annotation to a node

func AnnotateObject added in v1.3.0

func AnnotateObject(ctx context.Context, obj client.Object, key, value string, c client.Client) error

AnnotateObject adds annotation to a kubernetes object

func GetChrootExtension added in v1.3.0

func GetChrootExtension() string

func GetHostExtension added in v1.3.0

func GetHostExtension() string

func GetHostExtensionPath added in v1.3.0

func GetHostExtensionPath(path string) string

func IsCommandNotFound added in v1.3.0

func IsCommandNotFound(err error) bool

func IsExternalControlPlaneCluster added in v1.3.0

func IsExternalControlPlaneCluster(c client.Client) (bool, error)

IsExternalControlPlaneCluster detects control plane location of the cluster. On OpenShift, the control plane topology is configured in configv1.Infrastucture struct. On kubernetes, it is determined by which node the sriov operator is scheduled on. If operator pod is schedule on worker node, it is considered as external control plane.

func IsSingleNodeCluster added in v1.2.0

func IsSingleNodeCluster(c client.Client) (bool, error)

func LabelNode added in v1.5.0

func LabelNode(ctx context.Context, nodeName string, key, value string, c client.Client) error

LabelNode add label to a node

func ObjectHasAnnotation added in v1.3.0

func ObjectHasAnnotation(obj metav1.Object, annoKey string, value string) bool

ObjectHasAnnotation checks if a kubernetes object already contains annotation

func ObjectHasAnnotationKey added in v1.3.0

func ObjectHasAnnotationKey(obj metav1.Object, annoKey string) bool

ObjectHasAnnotationKey checks if a kubernetes object already contains annotation

func RemoveLabelFromNode added in v1.5.0

func RemoveLabelFromNode(ctx context.Context, nodeName string, key string, c client.Client) error

func Shutdown added in v1.1.0

func Shutdown()

Types

type CmdInterface added in v1.3.0

type CmdInterface interface {
	Chroot(string) (func() error, error)
	RunCommand(string, ...string) (string, string, error)
}

func New added in v1.3.0

func New() CmdInterface

Directories

Path Synopsis
Package mock_utils is a generated GoMock package.
Package mock_utils is a generated GoMock package.

Jump to

Keyboard shortcuts

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