package
1.12.0-alpha.0
Repository: https://github.com/karmada-io/karmada.git
Documentation: pkg.go.dev

# Functions

AddTolerations add some tolerations if not existed.
AggregateClusterResourceBindingWorkStatus will collect all work statuses with current ClusterResourceBinding objects, then aggregate status info to current ClusterResourceBinding status.
AggregateResourceBindingWorkStatus will collect all work statuses with current ResourceBinding objects, then aggregate status info to current ResourceBinding status.
ApplyReplica applies the Replica value for the specific field.
BuildStatusRawExtension builds raw JSON by a status map.
ConstructClusterWideKey construct resource ClusterWideKey from binding's objectReference.
ConstructObjectReference constructs ObjectReference from ResourceSelector.
ContainsServiceImport Check whether the ResourceSelectors of the policy contain ResourceSelector, and its Kind is ServiceImport.
ConvertToTypedObject converts an unstructured object to typed.
CreateOrUpdateEndpointSlice creates a EndpointSlice object if not exist, or updates if it already exists.
CreateOrUpdateWork creates a Work object if not exist, or updates if it already exists.
DeleteEndpointSlice will delete all EndpointSlice objects by labels.
DeleteWorks will delete all Work objects by labels.
EmitClusterEvictionEventForClusterResourceBinding records the eviction event for clusterResourceBinding and its objectReference.
EmitClusterEvictionEventForResourceBinding records the eviction event for resourceBinding and its objectReference.
FetchResourceTemplate fetches the resource template to be propagated.
FetchResourceTemplatesByLabelSelector fetches the resource templates by label selector to be propagated.
FindOrphanWorks retrieves all works that labeled with current binding(ResourceBinding or ClusterResourceBinding) objects, then pick the works that not meet current binding declaration.
GenerateNodeClaimByPodSpec will return a NodeClaim from PodSpec.
GeneratePodFromTemplateAndNamespace generates a simple pod object from the given podTemplate and namespace, then returns the generated pod.
GenerateReplicaRequirements generates replica requirements for node and resources.
GenEventRef returns the event reference.
GenFieldMergePatch will return a merge patch document capable of converting the original field to the modified field.
GenMergePatch will return a merge patch document capable of converting the original object to the modified object.
GetAppliedPlacement will get applied placement from annotations.
GetClusterResourceBindings returns a ClusterResourceBindingList by labels.
GetConsumerClusters will extract the target consumer clusters of the service.
GetCronFederatedHPAFailedHistoryLimits returns the failed history limits of the CronFederatedHPA.
GetCronFederatedHPAKey returns the key of the CronFederatedHPA.
GetCronFederatedHPASuccessHistoryLimits returns the successful history limits of the CronFederatedHPA.
GetDependenciesFromPodTemplate extracts the dependencies from the given pod and returns that.
GetEndpointSlices returns a EndpointSliceList by labels.
GetJobFinishedStatus checks whether the given Job has finished execution.
GetManifestIndex gets the index of clusterObj in manifest list, if not exist return -1.
GetMatchingTolerations returns true and list of Tolerations matching all Taints if all are tolerated, or false otherwise.
GetMinTolerationTime returns minimal toleration time from the given slice, or -1 if it's infinite.
GetNoExecuteTaints will get all NoExecute taints.
GetObjectFromCache gets full object information from cache by key in worker queue.
GetObjectFromSingleClusterCache gets full object information from single cluster cache by key in worker queue.
GetPodCondition extracts the provided condition from the given status and returns that.
GetPodConditionFromList extracts the provided condition from the given list of condition and returns the index of the condition and the condition.
GetPodReadyCondition extracts the pod ready condition from the given status and returns that.
GetProviderClusters will extract the target provider clusters of the service.
GetResourceBindings returns a ResourceBindingList by labels.
GetStaticWeightInfoListByTargetClusters constructs a weight list by target cluster slice.
GetWorksByBindingID gets WorkList by matching same binding's permanent id.
GetWorksByLabelsSet gets WorkList by matching labels.Set.
HasNoExecuteTaints check if NoExecute taints exist.
IsAPIEnabled checks if target API (or CRD) referencing by groupVersion and kind has been installed.
IsBindingScheduled will check if resourceBinding/clusterResourceBinding is successfully scheduled.
IsClusterOverridePolicyExist checks if specific ClusterOverridePolicy exist.
IsCronFederatedHPARuleSuspend returns true if the CronFederatedHPA is suspended.
IsDependentClusterOverridesPresent checks if a ClusterPropagationPolicy's dependent ClusterOverridePolicy all exist.
IsDependentOverridesPresent checks if a PropagationPolicy's dependent OverridePolicy all exist.
IsOverridePolicyExist checks if specific OverridePolicy exist.
IsPodReady returns true if a pod is ready; false otherwise.
IsPodReadyConditionTrue returns true if a pod is ready; false otherwise.
IsReplicaDynamicDivided checks if a PropagationPolicy schedules replicas as dynamic.
IsResourceApplied checks whether resource has been dispatched to member cluster or not.
IsWorkContains checks if the target resource exists in a work.spec.workload.manifests.
IsWorkSuspendDispatching checks if the work is suspended from dispatching.
MultiClusterServiceCrossClusterEnabled will check if it's a CrossCluster MultiClusterService.
NewClusterPredicateOnAgent generates an event filter function with Cluster for karmada-agent.
NewDispenser will construct a dispenser with target replicas and a prescribed initial result.
NewExecutionPredicate generates the event filter function to skip events that the controllers are uninterested.
NewExecutionPredicateOnAgent generates the event filter function to skip events that the controllers are uninterested.
NewNotReadyToleration returns a default not ready toleration.
NewPredicateForEndpointSliceCollectController generates an event filter function for EndpointSliceCollectController running by karmada-controller-manager.
NewPredicateForEndpointSliceCollectControllerOnAgent generates an event filter function for EndpointSliceCollectController running by karmada-agent.
NewPredicateForServiceExportController generates an event filter function for ServiceExport controller running by karmada-controller-manager.
NewPredicateForServiceExportControllerOnAgent generates an event filter function for ServiceExport controller running by karmada-agent.
NewUnreachableToleration returns a default unreachable toleration.
NodeReady checks whether the node condition is ready.
ObtainBindingSpecExistingClusters will obtain the cluster slice existing in the binding's spec field.
ParsingJobStatus generates new status of given 'AggregatedStatusItem'.
RemoveOrphanWorks will remove orphan works.
SetCurrentClusterTaints sets current cluster taints which need to be updated.
SetDefaultGracePeriodSeconds sets the default value of GracePeriodSeconds in ApplicationFailoverBehavior.
SetDefaultSpreadConstraints set default spread constraints if both 'SpreadByField' and 'SpreadByLabel' not set.
SetReplicaDivisionPreferenceWeighted sets the default value of ReplicaDivisionPreference to Weighted.
SpreadReplicasByTargetClusters divides replicas by the weight of a target cluster list.
TaintExists checks if the given taint exists in list of taints.
TolerationExists checks if the given toleration exists in list of tolerations.
ToUnstructured converts a typed object to an unstructured object.
UpdateStatus updates the given object's status in the Kubernetes cluster.

# Constants

FullyAppliedFailedMessage defines the failure message for the FullyApplied condition.
FullyAppliedFailedReason defines the failure reason for the FullyApplied condition.
FullyAppliedSuccessMessage defines the success message for the FullyApplied condition.
FullyAppliedSuccessReason defines the success reason for the FullyApplied condition.

# Structs

ClusterWeightInfo records the weight of a cluster.
Dispenser aims to divide replicas among clusters by different weights.
ManifestReference identifies an object in manifest list.

# Type aliases

ClusterWeightInfoList is a slice of ClusterWeightInfo that implements sort.Interface to sort by Value.