resourcetracker

package
v1.4.0-alpha.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2022 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Finalizer for resourcetracker to clean up recorded resources
	Finalizer = "resourcetracker.core.oam.dev/finalizer"
)

Variables

View Source
var (
	// OptimizeListOp optimize ResourceTracker List Op by adding index
	OptimizeListOp = true
)

Functions

func AddResourceTrackerCacheIndex

func AddResourceTrackerCacheIndex(cache cache.Cache) error

AddResourceTrackerCacheIndex add indexing configuration for cache

func CreateComponentRevisionResourceTracker

func CreateComponentRevisionResourceTracker(ctx context.Context, cli client.Client, app *v1beta1.Application) (*v1beta1.ResourceTracker, error)

CreateComponentRevisionResourceTracker create resourcetracker to record all component revision for application

func CreateCurrentResourceTracker

func CreateCurrentResourceTracker(ctx context.Context, cli client.Client, app *v1beta1.Application) (*v1beta1.ResourceTracker, error)

CreateCurrentResourceTracker create versioned resourcetracker for the latest generation of application

func CreateRootResourceTracker

func CreateRootResourceTracker(ctx context.Context, cli client.Client, app *v1beta1.Application) (*v1beta1.ResourceTracker, error)

CreateRootResourceTracker create root resourcetracker for application

func DeletedManifestInResourceTracker

func DeletedManifestInResourceTracker(ctx context.Context, cli client.Client, rt *v1beta1.ResourceTracker, manifest *unstructured.Unstructured, remove bool) error

DeletedManifestInResourceTracker marks resources as deleted in resourcetracker, if remove is true, resources will be removed from resourcetracker

func ExtendResourceTrackerListOption

func ExtendResourceTrackerListOption(list client.ObjectList, opts []client.ListOption) []client.ListOption

ExtendResourceTrackerListOption wraps list rt options by adding indexing fields

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

func RecordManifestsInResourceTracker added in v1.2.3

func RecordManifestsInResourceTracker(ctx context.Context, cli client.Client, rt *v1beta1.ResourceTracker, manifests []*unstructured.Unstructured, metaOnly bool) error

RecordManifestsInResourceTracker records resources in ResourceTracker

func SortResourceTrackersByVersion

func SortResourceTrackersByVersion(rts []*v1beta1.ResourceTracker, descending bool) []*v1beta1.ResourceTracker

SortResourceTrackersByVersion sort resourceTrackers by version

Types

type ResourceDetailRetriever added in v1.3.1

type ResourceDetailRetriever func(*resourceRow, string) error

ResourceDetailRetriever retriever to get details for resource

func RetrieveKubeCtlGetMessageGenerator added in v1.3.1

func RetrieveKubeCtlGetMessageGenerator(cfg *rest.Config) (ResourceDetailRetriever, error)

RetrieveKubeCtlGetMessageGenerator get details like kubectl get

type ResourceTreePrintOptions added in v1.3.1

type ResourceTreePrintOptions struct {
	DetailRetriever ResourceDetailRetriever
	multicluster.ClusterMapper
	// MaxWidth if set, the detail part will auto wrap
	MaxWidth *int
	// Format for details
	Format string
}

ResourceTreePrintOptions print options for resource tree

func (*ResourceTreePrintOptions) PrintResourceTree added in v1.3.1

func (options *ResourceTreePrintOptions) PrintResourceTree(writer io.Writer, currentPlacements []v1alpha1.PlacementDecision, currentRT *v1beta1.ResourceTracker, historyRT []*v1beta1.ResourceTracker)

PrintResourceTree print resource tree to writer

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL