version

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2018 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 a new 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)

	// Methods that interact with the API
	Create(obj pkgruntime.Object) (pkgruntime.Object, error)
	Get(qualifiedName util.QualifiedName) (pkgruntime.Object, error)
	List(namespace string) (pkgruntime.Object, error)
	UpdateStatus(obj pkgruntime.Object) (pkgruntime.Object, error)
}

type VersionManager

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

func NewNamespacedVersionManager

func NewNamespacedVersionManager(client fedclientset.Interface, templateKind, 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 template, and they should be removed by the garbage collector on template removal.

func (*VersionManager) Get

func (m *VersionManager) Get(template, override *unstructured.Unstructured) map[string]string

Get retrieves a mapping of cluster names to versions for the given template and override.

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(template, override *unstructured.Unstructured,
	selectedClusters []string, versionMap map[string]string)

Update ensures that the propagated version for the given template and override is recorded.

Jump to

Keyboard shortcuts

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