version

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: May 6, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VersionMapToClusterVersions

func VersionMapToClusterVersions(versionMap map[string]string) []fedv1a1.ClusterObjectVersion

Types

type VersionAdapter

type VersionAdapter interface {
	TypeName() string

	// Create an empty instance of the version type
	NewObject() pkgruntime.Object
	// Create an empty instance of list version type
	NewListObject() pkgruntime.Object
	// Create a populated instance of the version type
	NewVersion(qualifiedName util.QualifiedName, ownerReference metav1.OwnerReference, status *fedv1a1.PropagatedVersionStatus) pkgruntime.Object

	// Type-agnostic access / mutation of the Status field of a version resource
	GetStatus(obj pkgruntime.Object) *fedv1a1.PropagatedVersionStatus
	SetStatus(obj pkgruntime.Object, status *fedv1a1.PropagatedVersionStatus)
}

func NewVersionAdapter added in v0.0.3

func NewVersionAdapter(namespaced bool) VersionAdapter

type VersionManager

type VersionManager struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewVersionManager added in v0.0.3

func NewVersionManager(client generic.Client, namespaced bool, federatedKind, targetKind, namespace string) *VersionManager

func (*VersionManager) Delete

func (m *VersionManager) Delete(qualifiedName util.QualifiedName)

Delete removes the named propagated version from the manager. Versions are written to the API with an owner reference to the versioned resource, and they should be removed by the garbage collector when the resource is removed.

func (*VersionManager) Get

func (m *VersionManager) Get(resource VersionedResource) (map[string]string, error)

Get retrieves a mapping of cluster names to versions for the given versioned resource.

func (*VersionManager) HasSynced

func (m *VersionManager) HasSynced() bool

HasSynced indicates whether the manager's in-memory state has been synced with the api.

func (*VersionManager) Sync

func (m *VersionManager) Sync(stopChan <-chan struct{})

Sync retrieves propagated versions from the api and loads it into memory.

func (*VersionManager) Update

func (m *VersionManager) Update(resource VersionedResource,
	selectedClusters []string, versionMap map[string]string) error

Update ensures that the propagated version for the given versioned resource is recorded.

type VersionedResource added in v0.0.5

type VersionedResource interface {
	FederatedName() util.QualifiedName
	Object() *unstructured.Unstructured
	TemplateVersion() (string, error)
	OverrideVersion() (string, error)
}

VersionedResource defines the methods a federated resource must implement to allow versions to be tracked by the VersionManager.

Jump to

Keyboard shortcuts

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