output

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2020 License: Apache-2.0 Imports: 11 Imported by: 17

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResourceList

type ResourceList struct {
	// the desired resources should share the given labels
	Resources []ezkube.Object

	// list function that will be used to compare the given resources to the currently existing state.
	// if the resources in the list do not match those returned by the list func,
	// the differences will be reconciled by applying the snapshot.
	// if this function is nil, no garbage collection will be done.
	ListFunc func(ctx context.Context, cli client.Client) ([]ezkube.Object, error)
}

a ResourceList define a list of resources we wish to write to kubernetes. A ListFunc can be provided to compare the resources with what is currently written to storage and trim stale resources. A transition function can also be provided for updating existing resources.

func (ResourceList) SplitByClusterName

func (l ResourceList) SplitByClusterName() map[string]ResourceList

partition the resource list by the ClusterName of each object.

type Snapshot

type Snapshot struct {
	// name of the snapshot, used for metrics
	Name string

	ListsToSync []ResourceList
}

an Output Snapshot defines a list of desired resources to apply to Kubernetes. Stale resources (resources with no parents) will be garbage collected.

A resources is determined to be stale when it currently exists in the cluster, but does not exist in the snapshot.

func (Snapshot) Sync

func (s Snapshot) Sync(ctx context.Context, cli client.Client) error

sync the output snapshot to storage

func (Snapshot) SyncMultiCluster

func (s Snapshot) SyncMultiCluster(ctx context.Context, mcClient multicluster.Client) error

sync the output snapshot to storage across multiple clusters. uses the object's ClusterName to determine the correct destination cluster.

Jump to

Keyboard shortcuts

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