status

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseClusterPolicyStatusEventBundle added in v0.7.0

type BaseClusterPolicyStatusEventBundle struct {
	LeafHubName        string                                         `json:"leafHubName"`
	PolicyStatusEvents map[string]([]*models.LocalClusterPolicyEvent) `json:"policyStatusEvents"`
	BundleVersion      *BundleVersion                                 `json:"bundleVersion"`
}

ClusterPolicyHistoryEventBundle the base struct for cluster policy history event bundle.

func (*BaseClusterPolicyStatusEventBundle) GetLeafHubName added in v0.7.0

func (bundle *BaseClusterPolicyStatusEventBundle) GetLeafHubName() string

func (*BaseClusterPolicyStatusEventBundle) GetObjects added in v0.7.0

func (bundle *BaseClusterPolicyStatusEventBundle) GetObjects() []interface{}

func (*BaseClusterPolicyStatusEventBundle) GetVersion added in v0.7.0

func (bundle *BaseClusterPolicyStatusEventBundle) GetVersion() *BundleVersion

type BaseClustersPerPolicyBundle

type BaseClustersPerPolicyBundle struct {
	Objects       []*PolicyGenericComplianceStatus `json:"objects"`
	LeafHubName   string                           `json:"leafHubName"`
	BundleVersion *BundleVersion                   `json:"bundleVersion"`
}

BaseClustersPerPolicyBundle the base struct for clusters per policy bundle and contains the full state.

type BaseCompleteComplianceStatusBundle

type BaseCompleteComplianceStatusBundle struct {
	Objects           []*PolicyCompleteComplianceStatus `json:"objects"`
	LeafHubName       string                            `json:"leafHubName"`
	BaseBundleVersion *BundleVersion                    `json:"baseBundleVersion"`
	BundleVersion     *BundleVersion                    `json:"bundleVersion"`
}

BaseCompleteComplianceStatusBundle the base struct for complete state compliance status bundle.

type BaseDeltaComplianceStatusBundle

type BaseDeltaComplianceStatusBundle struct {
	Objects           []*PolicyGenericComplianceStatus `json:"objects"`
	LeafHubName       string                           `json:"leafHubName"`
	BaseBundleVersion *BundleVersion                   `json:"baseBundleVersion"`
	BundleVersion     *BundleVersion                   `json:"bundleVersion"`
}

BaseDeltaComplianceStatusBundle the base struct for delta state compliance status bundle.

type BaseLeafHubClusterInfoStatusBundle added in v0.7.0

type BaseLeafHubClusterInfoStatusBundle struct {
	Objects       []*LeafHubClusterInfo `json:"objects"`
	LeafHubName   string                `json:"leafHubName"`
	BundleVersion *BundleVersion        `json:"bundleVersion"`
}

BaseLeafHubClusterInfoStatusBundle the bundle for the hub cluster info.

func (*BaseLeafHubClusterInfoStatusBundle) GetLeafHubName added in v0.7.0

func (baseBundle *BaseLeafHubClusterInfoStatusBundle) GetLeafHubName() string

GetLeafHubName returns the leaf hub name that sent the bundle.

func (*BaseLeafHubClusterInfoStatusBundle) GetObjects added in v0.7.0

func (baseBundle *BaseLeafHubClusterInfoStatusBundle) GetObjects() []interface{}

GetObjects return all the objects that the bundle holds.

func (*BaseLeafHubClusterInfoStatusBundle) GetVersion added in v0.7.0

func (baseBundle *BaseLeafHubClusterInfoStatusBundle) GetVersion() *BundleVersion

GetVersion returns the bundle version.

type BaseMinimalComplianceStatusBundle

type BaseMinimalComplianceStatusBundle struct {
	Objects       []*MinimalPolicyComplianceStatus `json:"objects"`
	LeafHubName   string                           `json:"leafHubName"`
	BundleVersion *BundleVersion                   `json:"bundleVersion"`
}

BaseMinimalComplianceStatusBundle the base struct for minimal compliance status bundle.

type Bundle added in v0.7.0

type Bundle interface {
	// GetLeafHubName returns the leaf hub name that sent the bundle.
	GetLeafHubName() string
	// GetObjects returns the objects in the bundle.
	GetObjects() []interface{}
	// GetVersion returns the bundle version.
	GetVersion() *BundleVersion
}

Bundle bundles together a set of objects that were sent from leaf hubs via transport layer.

func NewClusterPolicyStatusEventBundle added in v0.7.0

func NewClusterPolicyStatusEventBundle() Bundle

for manager

type BundleVersion

type BundleVersion struct {
	Incarnation uint64 `json:"incarnation"`
	Generation  uint64 `json:"generation"`
}

BundleVersion holds the information necessary for the consumers of status bundles to compare versions correctly. Incarnation is the instance-version of the sender component, a counter that increments on restarts of the latter. Generation is the bundle-version relative to the sender's instance, increments on bundle updates.

func NewBundleVersion

func NewBundleVersion(incarnation uint64, generation uint64) *BundleVersion

NewBundleVersion returns a new instance of BundleVersion.

func (*BundleVersion) Equals

func (version *BundleVersion) Equals(other *BundleVersion) bool

Equals returns whether the caller's version is equal to that received as argument.

func (*BundleVersion) NewerThan

func (version *BundleVersion) NewerThan(other *BundleVersion) bool

NewerThan returns whether the caller's version is newer than that received as argument.

If other = nil the result is true.

func (*BundleVersion) String

func (version *BundleVersion) String() string

String returns string representation of the bundle version.

type CreateBundleFunction added in v0.7.0

type CreateBundleFunction func() Bundle

CreateBundleFunction function that specifies how to create a bundle.

type DeltaStateBundle added in v0.7.0

type DeltaStateBundle interface {
	DependantBundle
	// InheritEvents inherits the events in an older delta-bundle into the receiver (in-case of conflict, the receiver
	// is the source of truth).
	InheritEvents(olderBundle Bundle) error
}

DeltaStateBundle abstracts the functionality required from a Bundle to be used as Delta-State bundle.

type DependantBundle added in v0.7.0

type DependantBundle interface {
	Bundle
	// GetDependencyVersion returns the bundle dependency required version.
	GetDependencyVersion() *BundleVersion
}

DependantBundle is a bundle that depends on a different bundle. to support bundles dependencies additional function is required - GetDependencyVersion, in order to start processing the dependant bundle only after its required dependency (with required version) was processed.

type LeafHubClusterInfo added in v0.7.0

type LeafHubClusterInfo struct {
	LeafHubName string `json:"leafHubName"`
	ConsoleURL  string `json:"consoleURL"`
}

LeafHubClusterInfo manages leaf hub cluster info.

func (LeafHubClusterInfo) TableName added in v0.7.0

func (LeafHubClusterInfo) TableName() string

type MinimalPolicyComplianceStatus

type MinimalPolicyComplianceStatus struct {
	PolicyID             string                     `json:"policyId"`
	NamespacedName       string                     `json:"-"` // need it to delete obj from bundle for local resources.
	RemediationAction    policyv1.RemediationAction `json:"remediationAction"`
	NonCompliantClusters int                        `json:"nonCompliantClusters"`
	AppliedClusters      int                        `json:"appliedClusters"`
}

MinimalPolicyComplianceStatus holds information for minimal policy compliance status.

type PolicyCompleteComplianceStatus

type PolicyCompleteComplianceStatus struct {
	PolicyID                  string   `json:"policyId"`
	NamespacedName            string   `json:"-"` // need it to delete obj from bundle for local resources.
	NonCompliantClusters      []string `json:"nonCompliantClusters"`
	UnknownComplianceClusters []string `json:"unknownComplianceClusters"`
}

PolicyCompleteComplianceStatus holds information for (optimized) policy compliance status.

type PolicyGenericComplianceStatus

type PolicyGenericComplianceStatus struct {
	PolicyID                  string   `json:"policyId"`
	NamespacedName            string   `json:"-"` // need it to delete obj from bundle for these without finalizer.
	CompliantClusters         []string `json:"compliantClusters"`
	NonCompliantClusters      []string `json:"nonCompliantClusters"`
	UnknownComplianceClusters []string `json:"unknownComplianceClusters"`
}

PolicyGenericComplianceStatus holds information for policy compliance status and may be used either for complete or delta state bundles.

Jump to

Keyboard shortcuts

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