synccommon

package
v0.0.0-...-55cde4f Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyAuthoritativeAPI

func ApplyAuthoritativeAPI[
	statusPT syncStatusApplyConfigurationP[statusT, statusPT],
	objPT syncObjApplyConfigurationP[objT, objPT, statusPT],
	statusT, objT any,
](
	ctx context.Context, k8sClient client.Client, controllerName string,
	newApplyConfig syncObjApplyConfigurationConstructor[objPT, statusPT], mapiObj client.Object,
	authority mapiv1beta1.MachineAuthority,
) error

ApplyAuthoritativeAPI writes the status of the migration controller to a MAPI object.

func ApplyAuthoritativeAPIAndResetSyncStatus

func ApplyAuthoritativeAPIAndResetSyncStatus[
	statusPT syncStatusApplyConfigurationP[statusT, statusPT],
	objPT syncObjApplyConfigurationP[objT, objPT, statusPT],
	statusT, objT any,
](
	ctx context.Context, k8sClient client.Client, controllerName string,
	newApplyConfig syncObjApplyConfigurationConstructor[objPT, statusPT], mapiObj client.Object,
	authority mapiv1beta1.MachineAuthority,
) error

ApplyAuthoritativeAPIAndResetSyncStatus writes the status of the migration controller, and also resets the status written by the sync controller. It does this in a single operation, using the field owner of the migration controller.

Due to the potential for racing with the sync controller, it sets ResourceVersion in the operation.

func ApplySyncStatus

func ApplySyncStatus[
	statusPT syncStatusApplyConfigurationP[statusT, statusPT],
	objPT syncObjApplyConfigurationP[objT, objPT, statusPT],
	statusT, objT any,
](
	ctx context.Context, k8sClient client.Client, controllerName string,
	applyConfigConstructor syncObjApplyConfigurationConstructor[objPT, statusPT], mapiObj client.Object,
	status corev1.ConditionStatus, reason, message string, generation *int64,
) error

ApplySyncStatus updates the MAPI object status for a sync controller, either Machine or MachineSet.

Go is not yet able to correctly infer the first type argument, so it must be provided explicitly. The remaining type arguments will be inferred, and can be omitted.

Types

This section is empty.

Jump to

Keyboard shortcuts

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