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
- func RemoveFinalizer(object runtime.Object, finalizerName string) (finalizersUpdated bool)
- func UpdateManifestWorkStatus(ctx context.Context, client workv1client.ManifestWorkInterface, ...) (*workapiv1.ManifestWorkStatus, bool, error)
- type PlacementDecisionGetter
- type UpdateManifestWorkStatusFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppliedManifestworkAgentIDFilter ¶ added in v0.10.0
func AppliedManifestworkAgentIDFilter(agentID string) factory.EventFilterFunc
AppliedManifestworkAgentIDFilter filter the appliedmanifestwork belonging to this work agent
func AppliedManifestworkHubHashFilter ¶ added in v0.9.0
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 ¶ added in v0.8.0
func BuildResourceMeta ¶ added in v0.10.0
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 ¶ added in v0.8.0
func FindManifestConiguration(resourceMeta workapiv1.ManifestResourceMeta, manifestOptions []workapiv1.ManifestConfigOption) *workapiv1.ManifestConfigOption
func GetClusters ¶ added in v0.10.0
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 ¶ added in v0.11.0
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 ¶ added in v0.5.0
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 ¶ added in v0.5.0
func NewAppliedManifestWorkOwner(appliedWork *workapiv1.AppliedManifestWork) *metav1.OwnerReference
func OwnedByTheWork ¶ added in v0.9.0
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
func RemoveFinalizer ¶
RemoveFinalizer removes a finalizer from the list. It mutates its input.
func UpdateManifestWorkStatus ¶
func UpdateManifestWorkStatus( ctx context.Context, client workv1client.ManifestWorkInterface, manifestWork *workapiv1.ManifestWork, updateFuncs ...UpdateManifestWorkStatusFunc) (*workapiv1.ManifestWorkStatus, bool, error)
Types ¶
type PlacementDecisionGetter ¶ added in v0.10.0
type PlacementDecisionGetter struct {
Client clusterlister.PlacementDecisionLister
}
func (PlacementDecisionGetter) List ¶ added in v0.10.0
func (pdl PlacementDecisionGetter) List(selector labels.Selector, namespace string) ([]*clusterv1beta1.PlacementDecision, error)
type UpdateManifestWorkStatusFunc ¶
type UpdateManifestWorkStatusFunc func(status *workapiv1.ManifestWorkStatus) error