statusmanagerv1

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PolicyStatusKeyGetInfo added in v0.6.0

func PolicyStatusKeyGetInfo(key string) (string, string, error)

func UpdateVarmorClusterPolicyStatus added in v0.6.0

func UpdateVarmorClusterPolicyStatus(
	i varmorinterface.CrdV1beta1Interface,
	vcp *varmor.VarmorClusterPolicy,
	profileName string,
	ready bool,
	phase varmor.VarmorPolicyPhase,
	condType varmor.VarmorPolicyConditionType,
	status v1.ConditionStatus,
	reason, message string) error

func UpdateVarmorPolicyStatus added in v0.6.0

func UpdateVarmorPolicyStatus(
	i varmorinterface.CrdV1beta1Interface,
	vp *varmor.VarmorPolicy,
	profileName string,
	ready bool,
	phase varmor.VarmorPolicyPhase,
	condType varmor.VarmorPolicyConditionType,
	status v1.ConditionStatus,
	reason, message string) error

Types

type StatusManager

type StatusManager struct {
	UpdateDesiredNumber bool

	// Use "namespace/VarmorPolicyName" or "VarmorClusterPolicyName" as key.
	// One VarmorPolicy/ClusterPolicyName object corresponds to one PolicyStatus
	PolicyStatuses map[string]varmortypes.PolicyStatus
	// Use "namespace/VarmorPolicyName" as key. One VarmorPolicy object corresponds to one ModelingStatus
	// TODO: Rebuild ModelingStatuses from ArmorProfile object when leader change occurs.
	ModelingStatuses map[string]varmortypes.ModelingStatus
	ResetCh          chan string
	DeleteCh         chan string
	UpdateStatusCh   chan string
	UpdateModeCh     chan string
	// contains filtered or unexported fields
}

func NewStatusManager

func NewStatusManager(coreInterface corev1.CoreV1Interface,
	appsInterface appsv1.AppsV1Interface,
	varmorInterface varmorinterface.CrdV1beta1Interface,
	statusUpdateCycle time.Duration,
	debug bool,
	inContainer bool,
	metricsModule *varmormetrics.MetricsModule,
	log logr.Logger) *StatusManager

func (*StatusManager) CleanUp

func (m *StatusManager) CleanUp()

func (*StatusManager) Data

func (m *StatusManager) Data(c *gin.Context)

Data is an HTTP interface used for receiving the BehaviorData come from agents

func (*StatusManager) HandleProfileStatusUpdate added in v0.6.0

func (m *StatusManager) HandleProfileStatusUpdate(status varmortypes.ProfileStatus)

func (*StatusManager) Run

func (m *StatusManager) Run(stopCh <-chan struct{})

Run begins syncing the status of VarmorPolicy & ArmorPolicy.

func (*StatusManager) Status

func (m *StatusManager) Status(c *gin.Context)

Status is an HTTP interface used for receiving the status come from agents.

Jump to

Keyboard shortcuts

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