util

package
v0.5.32 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2025 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyKCCTargetConfigToCNC

func ApplyKCCTargetConfigToCNC(
	cnc *apisv1alpha1.CustomNodeConfig,
	gvr metav1.GroupVersionResource,
	targetResource util.KCCTargetResource,
	hash string,
)

ApplyKCCTargetConfigToCNC sets the hash value for the given configurations in CNC

func EnsureKCCTargetFinalizer

func EnsureKCCTargetFinalizer(ctx context.Context, unstructuredControl control.UnstructuredControl, finalizerName string,
	gvr metav1.GroupVersionResource, target *unstructured.Unstructured,
) (*unstructured.Unstructured, error)

EnsureKCCTargetFinalizer is used to add finalizer in kcc target any component (that depends on kcc target) should add a specific finalizer in the target CR

func FindMatchedKCCTargetConfigForNode

func FindMatchedKCCTargetConfigForNode(
	cnc *apisv1alpha1.CustomNodeConfig,
	kccTargetList []util.KCCTargetResource,
) (util.KCCTargetResource, error)

FindMatchedKCCTargetConfigForNode finds the KCC target that should be applied to this CNC. The KCCTs passed in must be non-terminating and updated. The rule of cnc match to config is: 1. if there is only one matched nodeNames config, return it 2. if there is only one matched labelSelector config with the highest priority, return it 3. if there is only one global config (neither nodeNames nor labelSelector exists), return it 4. otherwise, return nil to keep current state no changed

func IsCNCUpdated added in v0.5.14

func IsCNCUpdated(
	cnc *apisv1alpha1.CustomNodeConfig,
	gvr metav1.GroupVersionResource,
	targetResource util.KCCTargetResource,
	hash string,
) bool

func RemoveKCCTargetFinalizers added in v0.5.14

func RemoveKCCTargetFinalizers(
	ctx context.Context,
	unstructuredControl control.UnstructuredControl,
	gvr metav1.GroupVersionResource,
	target *unstructured.Unstructured,
	finalizers ...string,
) error

RemoveKCCTargetFinalizers removes finalizer(s) in kcc target

func UpdateKCCTGenericConditions

func UpdateKCCTGenericConditions(status *apisv1alpha1.GenericConfigStatus, conditionType apisv1alpha1.ConfigConditionType,
	conditionStatus v1.ConditionStatus, reason, message string,
) bool

UpdateKCCTGenericConditions is used to update conditions for kcc

Types

This section is empty.

Jump to

Keyboard shortcuts

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