Documentation ¶
Index ¶
- func AppliedManifestworkAgentIDFilter(agentID string) factory.EventFilterFunc
- func AppliedManifestworkHubHashFilter(hubHash string) factory.EventFilterFunc
- func AppliedManifestworkQueueKeyFunc(hubhash string) factory.ObjectQueueKeyFunc
- func ApplyOwnerReferences(ctx context.Context, dynamicClient dynamic.Interface, ...) error
- func BuildResourceMeta(index int, object runtime.Object, restMapper meta.RESTMapper) (workapiv1.ManifestResourceMeta, schema.GroupVersionResource, error)
- func DeleteAppliedResources(ctx context.Context, resources []workapiv1.AppliedManifestResourceMeta, ...) ([]workapiv1.AppliedManifestResourceMeta, []error)
- func FindManifestConiguration(resourceMeta workapiv1.ManifestResourceMeta, ...) *workapiv1.ManifestConfigOption
- func GetClusters(client clusterlister.PlacementDecisionLister, ...) (sets.Set[string], sets.Set[string], error)
- func GuessObjectGroupVersionKind(object runtime.Object) (*schema.GroupVersionKind, error)
- func HasFinalizer(finalizers []string, finalizer string) bool
- func HubHash(hubServer string) string
- func IsOwnedBy(myOwner metav1.OwnerReference, existingOwners []metav1.OwnerReference) bool
- func MergeManifestConditions(conditions, newConditions []workapiv1.ManifestCondition) []workapiv1.ManifestCondition
- func MergeStatusConditions(conditions []metav1.Condition, newConditions []metav1.Condition) []metav1.Condition
- func NewAppliedManifestWorkOwner(appliedWork *workapiv1.AppliedManifestWork) *metav1.OwnerReference
- func OwnedByTheWork(gvr schema.GroupVersionResource, namespace, name string, ...) bool
- type PlacementDecisionGetter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppliedManifestworkAgentIDFilter ¶
func AppliedManifestworkAgentIDFilter(agentID string) factory.EventFilterFunc
AppliedManifestworkAgentIDFilter filter the appliedmanifestwork belonging to this work agent
func AppliedManifestworkHubHashFilter ¶
func AppliedManifestworkHubHashFilter(hubHash string) factory.EventFilterFunc
AppliedManifestworkHubHashFilter filter the appliedmanifestwork belonging to this hub
func AppliedManifestworkQueueKeyFunc ¶
func AppliedManifestworkQueueKeyFunc(hubhash string) factory.ObjectQueueKeyFunc
AppliedManifestworkQueueKeyFunc return manifestwork key from appliedmanifestwork
func ApplyOwnerReferences ¶
func BuildResourceMeta ¶
func BuildResourceMeta( index int, object runtime.Object, restMapper meta.RESTMapper) (workapiv1.ManifestResourceMeta, schema.GroupVersionResource, error)
BuildResourceMeta builds manifest resource meta for the object
func DeleteAppliedResources ¶
func DeleteAppliedResources( ctx context.Context, resources []workapiv1.AppliedManifestResourceMeta, reason string, dynamicClient dynamic.Interface, recorder events.Recorder, owner metav1.OwnerReference) ([]workapiv1.AppliedManifestResourceMeta, []error)
DeleteAppliedResources deletes all given applied resources and returns those pending for finalization If the uid recorded in resources is different from what we get by client, ignore the deletion.
func FindManifestConiguration ¶
func FindManifestConiguration(resourceMeta workapiv1.ManifestResourceMeta, manifestOptions []workapiv1.ManifestConfigOption) *workapiv1.ManifestConfigOption
func GetClusters ¶
func GetClusters(client clusterlister.PlacementDecisionLister, placement *clusterv1beta1.Placement, existingClusters sets.Set[string]) (sets.Set[string], sets.Set[string], error)
Get added and deleted clusters names
func GuessObjectGroupVersionKind ¶
func GuessObjectGroupVersionKind(object runtime.Object) (*schema.GroupVersionKind, error)
GuessObjectGroupVersionKind returns GVK for the passed runtime object.
func HasFinalizer ¶
func HubHash ¶
HubHash returns a hash of hubserver NOTE: the length of hash string is 64, meaning the length of manifestwork name should be less than 189
func IsOwnedBy ¶
func IsOwnedBy(myOwner metav1.OwnerReference, existingOwners []metav1.OwnerReference) bool
IsOwnedBy check if owner exists in the ownerrefs.
func MergeManifestConditions ¶
func MergeManifestConditions(conditions, newConditions []workapiv1.ManifestCondition) []workapiv1.ManifestCondition
MergeManifestConditions return a new ManifestCondition array which merges the existing manifest conditions and the new manifest conditions. Rules to match ManifestCondition between two arrays: 1. match the manifest condition with the whole ManifestResourceMeta; 2. if not matched, try to match with properties other than ordinal in ManifestResourceMeta If no existing manifest condition is matched, the new manifest condition will be used.
func MergeStatusConditions ¶
func MergeStatusConditions(conditions []metav1.Condition, newConditions []metav1.Condition) []metav1.Condition
MergeStatusConditions returns a new status condition array with merged status conditions. It is based on newConditions, and merges the corresponding existing conditions if exists.
func NewAppliedManifestWorkOwner ¶
func NewAppliedManifestWorkOwner(appliedWork *workapiv1.AppliedManifestWork) *metav1.OwnerReference
func OwnedByTheWork ¶
func OwnedByTheWork(gvr schema.GroupVersionResource, namespace, name string, deleteOption *workapiv1.DeleteOption) bool
OwnedByTheWork checks whether the manifest resource will be owned by the manifest work based on the deleteOption
Types ¶
type PlacementDecisionGetter ¶
type PlacementDecisionGetter struct {
Client clusterlister.PlacementDecisionLister
}
func (PlacementDecisionGetter) List ¶
func (pdl PlacementDecisionGetter) List(selector labels.Selector, namespace string) ([]*clusterv1beta1.PlacementDecision, error)