syncer

package
v2.7.3 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: Apache-2.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// COInitParams stores the input params required for initiating the
	// CO agnostic orchestrator for the syncer container.
	COInitParams interface{}

	// MetadataSyncer instance for the syncer container.
	MetadataSyncer *metadataSyncInformer
)
View Source
var Version string

Version of the syncer. This should be set via ldflags.

Functions

func CsiFullSync

func CsiFullSync(ctx context.Context, metadataSyncer *metadataSyncInformer) error

CsiFullSync reconciles volume metadata on a vanilla k8s cluster with volume metadata on CNS.

func HasMigratedToAnnotationUpdate

func HasMigratedToAnnotationUpdate(ctx context.Context, prevAnnotations map[string]string,
	newAnnotations map[string]string, objectName string) bool

HasMigratedToAnnotationUpdate returns true if the migrated-to annotation is found in the newer object.

func InitMetadataSyncer

func InitMetadataSyncer(ctx context.Context, clusterFlavor cnstypes.CnsClusterFlavor,
	configInfo *cnsconfig.ConfigurationInfo) error

InitMetadataSyncer initializes the Metadata Sync Informer.

func IsMultiAttachAllowed

func IsMultiAttachAllowed(pv *v1.PersistentVolume) bool

IsMultiAttachAllowed helps check accessModes on the PV and return true if volume can be attached to multiple nodes.

func IsValidVolume

func IsValidVolume(ctx context.Context, volume v1.Volume, pod *v1.Pod,
	metadataSyncer *metadataSyncInformer) (bool, *v1.PersistentVolume, *v1.PersistentVolumeClaim)

IsValidVolume determines if the given volume mounted by a POD is a valid vsphere volume. Returns the pv and pvc object if true.

func PvcsiFullSync

func PvcsiFullSync(ctx context.Context, metadataSyncer *metadataSyncInformer) error

PvcsiFullSync reconciles PV/PVC/Pod metadata on the guest cluster with cnsvolumemetadata objects on the supervisor cluster for the guest cluster.

func ReloadConfiguration

func ReloadConfiguration(metadataSyncer *metadataSyncInformer, reconnectToVCFromNewConfig bool) error

ReloadConfiguration reloads configuration from the secret, and update controller's cached configs. The function takes metadatasyncerInformer and reconnectToVCFromNewConfig as parameters. If reconnectToVCFromNewConfig is set to true, the function re-establishes connection with VC. Otherwise, based on the configuration data changed during reload, the function resets config, reloads VC connection when credentials are changed and returns appropriate error.

Types

type ResizeReconciler

type ResizeReconciler interface {
	// Run starts the reconciler.
	Run(workers int, ctx context.Context)
}

ResizeReconciler is the interface of resizeReconciler.

type VolumeHealthReconciler

type VolumeHealthReconciler interface {
	// Run starts the reconciler.
	Run(ctx context.Context, workers int)
}

VolumeHealthReconciler is the interface for volume health reconciler.

func NewVolumeHealthReconciler

func NewVolumeHealthReconciler(

	tkgKubeClient kubernetes.Interface,

	svcKubeClient kubernetes.Interface,
	resyncPeriod time.Duration,
	tkgInformerFactory informers.SharedInformerFactory,
	svcInformerFactory informers.SharedInformerFactory,
	svcPVCRateLimiter workqueue.RateLimiter,
	supervisorNamespace string, stopCh <-chan struct{}) (VolumeHealthReconciler, error)

NewVolumeHealthReconciler returns a VolumeHealthReconciler.

Jump to

Keyboard shortcuts

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