Documentation
¶
Overview ¶
Package appkeeper builds a ResourceKeeper for an Application: it is the Application's implementation of the kind-agnostic library in pkg/resourcekeeper. It reads the resource policies from the Application's spec with pkg/policy, which merges several policies of one type, and passes them to the keeper as data.
Index ¶
- func DeleteManagedResourceInApplication(ctx context.Context, cli client.Client, mr v1beta1.ManagedResource, ...) error
- func ForeignTrackerRemedy(rtName string) string
- func IsResourceManagedByApplication(manifest *unstructured.Unstructured, app *v1beta1.Application) bool
- func KeeperOptions(cli client.Client, app *v1beta1.Application) resourcekeeper.Options
- func ListApplicationResourceTrackers(ctx context.Context, cli client.Client, app *v1beta1.Application) (rootRT *v1beta1.ResourceTracker, currentRT *v1beta1.ResourceTracker, ...)
- func ListApplicationRevisions(ctx context.Context, cli client.Client, appName string, appNs string) ([]v1beta1.ApplicationRevision, error)
- func New(ctx context.Context, cli client.Client, app *v1beta1.Application) (resourcekeeper.ResourceKeeper, error)
- func NewAppResourceTracker(app *v1beta1.Application) resourcetracker.Tracked
- func Policies(app *v1beta1.Application) (p resourcekeeper.Policies, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteManagedResourceInApplication ¶
func DeleteManagedResourceInApplication(ctx context.Context, cli client.Client, mr v1beta1.ManagedResource, obj *unstructured.Unstructured, app *v1beta1.Application, garbageCollectPolicy *v1alpha1.GarbageCollectPolicySpec) error
DeleteManagedResourceInApplication is resourcekeeper.DeleteManagedResource for an Application.
func ForeignTrackerRemedy ¶
ForeignTrackerRemedy is what to do with an earlier Application's ResourceTracker rtName: the controller and the Application webhook both name it, in these words.
func IsResourceManagedByApplication ¶
func IsResourceManagedByApplication(manifest *unstructured.Unstructured, app *v1beta1.Application) bool
IsResourceManagedByApplication is resourcekeeper.IsResourceManaged for an Application.
func KeeperOptions ¶
func KeeperOptions(cli client.Client, app *v1beta1.Application) resourcekeeper.Options
KeeperOptions backs the keeper's switches with KubeVela's feature gates (read on each use), acts as the user recorded on app, records GC stage timings in the reconcile stage histogram, and supplies the pre-v1.2 tracker clean-up.
func ListApplicationResourceTrackers ¶
func ListApplicationResourceTrackers(ctx context.Context, cli client.Client, app *v1beta1.Application) (rootRT *v1beta1.ResourceTracker, currentRT *v1beta1.ResourceTracker, historyRTs []*v1beta1.ResourceTracker, crRT *v1beta1.ResourceTracker, err error)
ListApplicationResourceTrackers list resource trackers for application with all historyRTs sorted by version number rootRT -> The ResourceTracker that records life-long resources. These resources will only be recycled when application is removed. currentRT -> The ResourceTracker that tracks the resources used by the latest version of application. historyRTs -> The ResourceTrackers that tracks the resources in outdated versions. crRT -> The ResourceTracker that tracks the component revisions created by the application.
func ListApplicationRevisions ¶
func ListApplicationRevisions(ctx context.Context, cli client.Client, appName string, appNs string) ([]v1beta1.ApplicationRevision, error)
ListApplicationRevisions get application revisions by label
func New ¶
func New(ctx context.Context, cli client.Client, app *v1beta1.Application) (resourcekeeper.ResourceKeeper, error)
New creates a ResourceKeeper for app, with the resource policies in its spec.
func NewAppResourceTracker ¶
func NewAppResourceTracker(app *v1beta1.Application) resourcetracker.Tracked
NewAppResourceTracker returns the resourcetracker.Tracked for an Application.
func Policies ¶
func Policies(app *v1beta1.Application) (p resourcekeeper.Policies, err error)
Policies parses the resource policies (apply-once, garbage-collect, shared-resource, take-over, read-only, resource-update) from app's spec. An absent policy is nil.
Types ¶
This section is empty.