Documentation
¶
Overview ¶
Package placement features a controller to reconcile the clusterResourcePlacement or resourcePlacement changes.
Index ¶
- Variables
- func BuildMasterResourceSnapshot(latestResourceSnapshotIndex, resourceSnapshotCount, envelopeObjCount int, ...) fleetv1beta1.ResourceSnapshotObj
- func BuildSubIndexResourceSnapshot(latestResourceSnapshotIndex, resourceSnapshotSubIndex int, ...) fleetv1beta1.ResourceSnapshotObj
- type Reconciler
Constants ¶
This section is empty.
Variables ¶
var ( ErrStillPendingManifest = fmt.Errorf("there are still manifest pending to be processed by the member cluster") ErrFailedManifest = fmt.Errorf("there are failed to apply manifests, please check the `failedResourcePlacements` status") )
Functions ¶
func BuildMasterResourceSnapshot ¶
func BuildMasterResourceSnapshot(latestResourceSnapshotIndex, resourceSnapshotCount, envelopeObjCount int, placementName, placementNamespace, resourceHash string, selectedResources []fleetv1beta1.ResourceContent) fleetv1beta1.ResourceSnapshotObj
TODO: move this to library package buildMasterResourceSnapshot builds and returns the master resource snapshot for the latest resource snapshot index and selected resources.
func BuildSubIndexResourceSnapshot ¶
func BuildSubIndexResourceSnapshot(latestResourceSnapshotIndex, resourceSnapshotSubIndex int, placementName, placementNamespace string, selectedResources []fleetv1beta1.ResourceContent) fleetv1beta1.ResourceSnapshotObj
TODO: move this to library package BuildSubIndexResourceSnapshot builds and returns the sub index resource snapshot for both cluster-scoped and namespace-scoped placements. Returns a ClusterResourceSnapshot for cluster-scoped placements (empty namespace) or ResourceSnapshot for namespace-scoped placements.
Types ¶
type Reconciler ¶
type Reconciler struct { // the informer contains the cache for all the resources we need. InformerManager informer.Manager // RestMapper is used to convert between gvk and gvr on known resources. RestMapper meta.RESTMapper // Client is used to update objects which goes to the api server directly. Client client.Client // UncachedReader is the uncached read-only client for accessing Kubernetes API server; in most cases client should // be used instead, unless consistency becomes a serious concern. // It's only needed by v1beta1 APIs. UncachedReader client.Reader // ResourceConfig contains all the API resources that we won't select based on allowed or skipped propagating APIs option. ResourceConfig *utils.ResourceConfig // SkippedNamespaces contains the namespaces that we should not propagate. SkippedNamespaces map[string]bool Recorder record.EventRecorder Scheme *runtime.Scheme // ResourceSnapshotCreationMinimumInterval is the minimum interval to create a new resourcesnapshot // to avoid too frequent updates. ResourceSnapshotCreationMinimumInterval time.Duration // ResourceChangesCollectionDuration is the duration for collecting resource changes into one snapshot. ResourceChangesCollectionDuration time.Duration }
Reconciler reconciles a cluster resource placement object
func (*Reconciler) Reconcile ¶
func (r *Reconciler) Reconcile(ctx context.Context, key controller.QueueKey) (ctrl.Result, error)
func (*Reconciler) ReconcileV1Alpha1 ¶
func (r *Reconciler) ReconcileV1Alpha1(ctx context.Context, key controller.QueueKey) (ctrl.Result, error)
ReconcileV1Alpha1 reconciles v1aplha1 APIs.