bundle

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bundle

type Bundle interface {
	// UpdateObject function to update a single object inside a bundle.
	UpdateObject(object Object)
	// DeleteObject function to delete a single object inside a bundle.
	DeleteObject(object Object)
	// GetBundleVersion function to get bundle generation.
	GetBundleVersion() *status.BundleVersion
}

Bundle is an abstraction for managing different bundle types.

func NewClustersPerPolicyBundle

func NewClustersPerPolicyBundle(leafHubName string, incarnation uint64,
	extractObjIDFunc ExtractObjIDFunc) Bundle

NewClustersPerPolicyBundle creates a new instance of ClustersPerPolicyBundle.

func NewCompleteComplianceStatusBundle added in v0.2.0

func NewCompleteComplianceStatusBundle(leafHubName string, baseBundle Bundle, incarnation uint64,
	extractObjIDFunc ExtractObjIDFunc) Bundle

NewCompleteComplianceStatusBundle creates a new instance of ComplianceStatusBundle.

func NewGenericStatusBundle

func NewGenericStatusBundle(leafHubName string, incarnation uint64, cleanObjFunc func(obj Object)) Bundle

NewGenericStatusBundle creates a new instance of GenericStatusBundle.

func NewMinimalComplianceStatusBundle

func NewMinimalComplianceStatusBundle(leafHubName string, incarnation uint64) Bundle

NewMinimalComplianceStatusBundle creates a new instance of MinimalComplianceStatusBundle.

type ClustersPerPolicyBundle

type ClustersPerPolicyBundle struct {
	statusbundle.BaseClustersPerPolicyBundle
	// contains filtered or unexported fields
}

ClustersPerPolicyBundle abstracts management of clusters per policy bundle.

func (*ClustersPerPolicyBundle) DeleteObject

func (bundle *ClustersPerPolicyBundle) DeleteObject(object Object)

DeleteObject function to delete a single object inside a bundle.

func (*ClustersPerPolicyBundle) GetBundleVersion added in v0.2.0

func (bundle *ClustersPerPolicyBundle) GetBundleVersion() *statusbundle.BundleVersion

GetBundleVersion function to get bundle version.

func (*ClustersPerPolicyBundle) UpdateObject

func (bundle *ClustersPerPolicyBundle) UpdateObject(object Object)

UpdateObject function to update a single object inside a bundle.

type ComplianceStatusBundle

type ComplianceStatusBundle struct {
	statusbundle.BaseCompleteComplianceStatusBundle
	// contains filtered or unexported fields
}

ComplianceStatusBundle abstracts management of compliance status bundle.

func (*ComplianceStatusBundle) DeleteObject

func (bundle *ComplianceStatusBundle) DeleteObject(object Object)

DeleteObject function to delete a single object inside a bundle.

func (*ComplianceStatusBundle) GetBundleVersion added in v0.2.0

func (bundle *ComplianceStatusBundle) GetBundleVersion() *statusbundle.BundleVersion

GetBundleVersion function to get bundle version.

func (*ComplianceStatusBundle) UpdateObject

func (bundle *ComplianceStatusBundle) UpdateObject(object Object)

UpdateObject function to update a single object inside a bundle.

type ControlInfoBundle added in v0.2.0

type ControlInfoBundle struct {
	LeafHubName   string                      `json:"leafHubName"`
	BundleVersion *statusbundle.BundleVersion `json:"bundleVersion"`
	// contains filtered or unexported fields
}

ControlInfoBundle holds control info passed from LH to HoH.

func NewControlInfoBundle added in v0.2.0

func NewControlInfoBundle(leafHubName string, incarnation uint64) *ControlInfoBundle

NewControlInfoBundle creates a new instance of ControlInfoBundle.

func (*ControlInfoBundle) DeleteObject added in v0.2.0

func (bundle *ControlInfoBundle) DeleteObject(Object)

DeleteObject function to delete a single object inside a bundle.

func (*ControlInfoBundle) GetBundleVersion added in v0.2.0

func (bundle *ControlInfoBundle) GetBundleVersion() *statusbundle.BundleVersion

GetBundleVersion function to get bundle version.

func (*ControlInfoBundle) UpdateObject added in v0.2.0

func (bundle *ControlInfoBundle) UpdateObject(Object)

UpdateObject function to update a single object inside a bundle.

type DeltaComplianceStatusBundle added in v0.2.0

type DeltaComplianceStatusBundle struct {
	statusbundle.BaseDeltaComplianceStatusBundle
	// contains filtered or unexported fields
}

DeltaComplianceStatusBundle abstracts management of compliance status bundle.

func (*DeltaComplianceStatusBundle) DeleteObject added in v0.2.0

func (bundle *DeltaComplianceStatusBundle) DeleteObject(object Object)

DeleteObject function to delete all instances of a single object inside a bundle.

func (*DeltaComplianceStatusBundle) GetBundleVersion added in v0.2.0

func (bundle *DeltaComplianceStatusBundle) GetBundleVersion() *statusbundle.BundleVersion

GetBundleVersion function to get bundle version.

func (*DeltaComplianceStatusBundle) GetTransportationID added in v0.2.0

func (bundle *DeltaComplianceStatusBundle) GetTransportationID() int

GetTransportationID function to get bundle transportation ID to be attached to message-key during transportation.

func (*DeltaComplianceStatusBundle) Reset added in v0.2.0

func (bundle *DeltaComplianceStatusBundle) Reset()

Reset flushes the objects in the bundle (after delivery).

func (*DeltaComplianceStatusBundle) SyncState added in v0.2.0

func (bundle *DeltaComplianceStatusBundle) SyncState()

SyncState syncs the state of the delta-bundle with the full-state.

func (*DeltaComplianceStatusBundle) UpdateObject added in v0.2.0

func (bundle *DeltaComplianceStatusBundle) UpdateObject(object Object)

UpdateObject function to update a single object inside a bundle.

type DeltaStateBundle added in v0.2.0

type DeltaStateBundle interface {
	Bundle
	// GetTransportationID function to get bundle transportation ID to be attached to message-key during transportation.
	GetTransportationID() int
	// SyncState syncs the state of the delta-bundle with the full-state.
	SyncState()
	// Reset flushes the delta-state bundle's objects.
	Reset()
}

DeltaStateBundle abstracts the logic needed from the delta-state bundle.

func NewDeltaComplianceStatusBundle added in v0.2.0

func NewDeltaComplianceStatusBundle(leafHubName string, baseBundle Bundle,
	clustersPerPolicyBundle *ClustersPerPolicyBundle, incarnation uint64,
	extractObjIDFunc ExtractObjIDFunc) DeltaStateBundle

NewDeltaComplianceStatusBundle creates a new instance of DeltaComplianceStatusBundle.

type ExtractObjIDFunc added in v0.2.0

type ExtractObjIDFunc func(obj Object) (string, bool)

ExtractObjIDFunc a function type used to get the id of an object.

type GenericStatusBundle

type GenericStatusBundle struct {
	Objects       []Object                    `json:"objects"`
	LeafHubName   string                      `json:"leafHubName"`
	BundleVersion *statusbundle.BundleVersion `json:"bundleVersion"`
	// contains filtered or unexported fields
}

GenericStatusBundle is a bundle that is used to send to the hub of hubs the leaf CR as is except for fields that are not relevant in the hub of hubs like finalizers, etc. for bundles that require more specific behavior, it's required to implement your own status bundle struct.

func (*GenericStatusBundle) DeleteObject

func (bundle *GenericStatusBundle) DeleteObject(object Object)

DeleteObject function to delete a single object inside a bundle.

func (*GenericStatusBundle) GetBundleVersion added in v0.2.0

func (bundle *GenericStatusBundle) GetBundleVersion() *statusbundle.BundleVersion

GetBundleVersion function to get bundle version.

func (*GenericStatusBundle) UpdateObject

func (bundle *GenericStatusBundle) UpdateObject(object Object)

UpdateObject function to update a single object inside a bundle.

type MinimalComplianceStatusBundle

type MinimalComplianceStatusBundle struct {
	statusbundle.BaseMinimalComplianceStatusBundle
	// contains filtered or unexported fields
}

MinimalComplianceStatusBundle abstracts management of minimal compliance status bundle.

func (*MinimalComplianceStatusBundle) DeleteObject

func (bundle *MinimalComplianceStatusBundle) DeleteObject(object Object)

DeleteObject function to delete a single object inside a bundle.

func (*MinimalComplianceStatusBundle) GetBundleVersion added in v0.2.0

func (bundle *MinimalComplianceStatusBundle) GetBundleVersion() *statusbundle.BundleVersion

GetBundleVersion function to get bundle version.

func (*MinimalComplianceStatusBundle) UpdateObject

func (bundle *MinimalComplianceStatusBundle) UpdateObject(object Object)

UpdateObject function to update a single object inside a bundle.

type Object

type Object interface {
	metav1.Object
	runtime.Object
}

Object is an interface for a single object inside a bundle.

Jump to

Keyboard shortcuts

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