common

package
v1.2.1-rc1 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ApplicationStatusInfoHealthy      = "Device's application workloads are healthy."
	ApplicationStatusInfoUndefined    = "Device has not reported any application workloads yet."
	DeviceStatusInfoHealthy           = "Device's system resources are healthy."
	DeviceStatusInfoRebooting         = "Device is rebooting."
	DeviceStatusInfoAwaitingReconnect = "Device has not reconnected since restore to confirm its current state."
	DeviceStatusInfoConflictPaused    = "" /* 132-byte string literal not displayed */
	CPUIsCritical                     = "CPU utilization has reached a critical level."
	CPUIsWarning                      = "CPU utilization has reached a warning level."
	CPUIsNormal                       = "CPU utilization has returned to normal."
	MemoryIsCritical                  = "Memory utilization has reached a critical level."
	MemoryIsWarning                   = "Memory utilization has reached a warning level."
	MemoryIsNormal                    = "Memory utilization has returned to normal."
	DiskIsCritical                    = "Disk utilization has reached a critical level."
	DiskIsWarning                     = "Disk utilization has reached a warning level."
	DiskIsNormal                      = "Disk utilization has returned to normal."
)

Variables

This section is empty.

Functions

func EmitMultipleOwnersEvents added in v0.9.0

func EmitMultipleOwnersEvents(ctx context.Context, device *domain.Device, oldCondition, newCondition *domain.Condition,
	createEvent func(context.Context, *domain.Event),
	getDeviceMultipleOwnersDetectedEvent func(context.Context, string, []string, logrus.FieldLogger) *domain.Event,
	getDeviceMultipleOwnersResolvedEvent func(context.Context, string, domain.DeviceMultipleOwnersResolvedDetailsResolutionType, *string, []string, logrus.FieldLogger) *domain.Event,
	log logrus.FieldLogger)

EmitMultipleOwnersEvents emits events for MultipleOwners condition changes

func EmitSpecValidEvents added in v0.9.0

func EmitSpecValidEvents(ctx context.Context, device *domain.Device, oldCondition, newCondition *domain.Condition,
	createEvent func(context.Context, *domain.Event),
	getDeviceSpecValidEvent func(ctx context.Context, deviceName string) *domain.Event,
	getDeviceSpecInvalidEvent func(ctx context.Context, deviceName string, message string) *domain.Event,
	log logrus.FieldLogger,
)

EmitSpecValidEvents emits events for SpecValid condition changes

func GetDependencyChangeDetectedEvent added in v1.2.0

func GetDependencyChangeDetectedEvent(ctx context.Context, kind domain.ResourceKind, name, resourceKey, fingerprint string) *domain.Event

GetDependencyChangeDetectedEvent creates an event when the sync controller detects an upstream change.

func GetDependencySyncProbeFailedEvent added in v1.2.0

func GetDependencySyncProbeFailedEvent(ctx context.Context, kind domain.ResourceKind, name, resourceKey, sanitizedError string) *domain.Event

GetDependencySyncProbeFailedEvent creates an audit event when a dependency probe fails.

func GetDeviceConflictPausedEvent added in v0.10.0

func GetDeviceConflictPausedEvent(ctx context.Context, deviceName string) *domain.Event

GetDeviceConflictPausedEvent creates an event for device being paused due to version conflict

func GetDeviceConflictResolvedEvent added in v0.10.0

func GetDeviceConflictResolvedEvent(ctx context.Context, deviceName string) *domain.Event

GetDeviceConflictResolvedEvent creates an event for device conflict being resolved

func GetDeviceDecommissionedFailureEvent added in v0.9.0

func GetDeviceDecommissionedFailureEvent(ctx context.Context, _ bool, _ domain.ResourceKind, resourceName string, status domain.Status) *domain.Event

GetDeviceDecommissionedFailureEvent creates an event for failed device decommission

func GetDeviceDecommissionedSuccessEvent added in v0.9.0

func GetDeviceDecommissionedSuccessEvent(ctx context.Context, _ bool, _ domain.ResourceKind, resourceName string, update *domain.ResourceUpdatedDetails, log logrus.FieldLogger) *domain.Event

GetDeviceDecommissionedSuccessEvent creates an event for successful device decommission

func GetDeviceEventFromUpdateDetails added in v0.9.0

func GetDeviceEventFromUpdateDetails(ctx context.Context, resourceName string, update ResourceUpdate) *domain.Event

GetDeviceEventFromUpdateDetails creates a device event from update details

func GetDeviceMultipleOwnersDetectedEvent added in v0.9.0

func GetDeviceMultipleOwnersDetectedEvent(ctx context.Context, deviceName string, matchingFleets []string, log logrus.FieldLogger) *domain.Event

GetDeviceMultipleOwnersDetectedEvent creates an event for multiple fleet owners detected

func GetDeviceMultipleOwnersResolvedEvent added in v0.9.0

func GetDeviceMultipleOwnersResolvedEvent(ctx context.Context, deviceName string, resolutionType domain.DeviceMultipleOwnersResolvedDetailsResolutionType, assignedOwner *string, previousMatchingFleets []string, log logrus.FieldLogger) *domain.Event

GetDeviceMultipleOwnersResolvedEvent creates an event for multiple fleet owners resolved

func GetDeviceSpecInvalidEvent added in v0.9.0

func GetDeviceSpecInvalidEvent(ctx context.Context, deviceName string, message string) *domain.Event

GetDeviceSpecInvalidEvent creates an event for device spec becoming invalid

func GetDeviceSpecValidEvent added in v0.9.0

func GetDeviceSpecValidEvent(ctx context.Context, deviceName string) *domain.Event

GetDeviceSpecValidEvent creates an event for device spec becoming valid

func GetEnrollmentRequestApprovalFailedEvent added in v0.9.0

func GetEnrollmentRequestApprovalFailedEvent(ctx context.Context, resourceName string, status domain.Status, log logrus.FieldLogger) *domain.Event

GetEnrollmentRequestApprovalFailedEvent creates an event for failed enrollment request approval

func GetEnrollmentRequestApprovedEvent added in v0.9.0

func GetEnrollmentRequestApprovedEvent(ctx context.Context, resourceName string, log logrus.FieldLogger) *domain.Event

GetEnrollmentRequestApprovedEvent creates an event for enrollment request approval

func GetFleetRolloutBatchCompletedEvent added in v0.9.0

func GetFleetRolloutBatchCompletedEvent(ctx context.Context, name string, deployingTemplateVersion string, report *domain.RolloutBatchCompletionReport) *domain.Event

GetFleetRolloutBatchCompletedEvent creates an event for fleet rollout completion

func GetFleetRolloutBatchDispatchedEvent added in v0.9.0

func GetFleetRolloutBatchDispatchedEvent(ctx context.Context, fleetName string, templateVersion string, batch string) *domain.Event

GetFleetRolloutBatchDispatchedEvent creates an event for fleet rollout batch dispatch

func GetFleetRolloutCompletedEvent added in v0.9.0

func GetFleetRolloutCompletedEvent(ctx context.Context, name string, templateVersion string) *domain.Event

GetFleetRolloutCompletedEvent creates an event for fleet rollout completion

func GetFleetRolloutDeviceSelectedEvent added in v0.9.0

func GetFleetRolloutDeviceSelectedEvent(ctx context.Context, deviceName string, fleetName string, templateVersion string) *domain.Event

GetFleetRolloutDeviceSelectedEvent creates an event for fleet rollout device selection

func GetFleetRolloutFailedEvent added in v0.9.0

func GetFleetRolloutFailedEvent(ctx context.Context, name string, deployingTemplateVersion string, message string) *domain.Event

GetFleetRolloutFailedEvent creates an event for fleet rollout failure

func GetFleetRolloutNewEvent added in v0.9.0

func GetFleetRolloutNewEvent(ctx context.Context, name string) *domain.Event

GetFleetRolloutNewEvent creates an event for fleet rollout creation

func GetFleetRolloutStartedEvent added in v0.9.0

func GetFleetRolloutStartedEvent(ctx context.Context, templateVersionName string, fleetName string, immediateRollout bool, policyRemoved bool) *domain.Event

GetFleetRolloutStartedEvent creates an event for fleet rollout start

func GetFleetSpecInvalidEvent added in v0.9.0

func GetFleetSpecInvalidEvent(ctx context.Context, fleetName string, message string) *domain.Event

GetFleetSpecInvalidEvent creates an event for fleet spec becoming invalid

func GetFleetSpecValidEvent added in v0.9.0

func GetFleetSpecValidEvent(ctx context.Context, fleetName string) *domain.Event

GetFleetSpecValidEvent creates an event for fleet spec becoming valid

func GetReferencedRepositoryUpdatedEvent added in v0.9.0

func GetReferencedRepositoryUpdatedEvent(ctx context.Context, kind domain.ResourceKind, name, repositoryName string) *domain.Event

GetReferencedRepositoryUpdatedEvent creates an event for a referenced repository being updated

func GetRepositoryAccessibleEvent added in v0.9.0

func GetRepositoryAccessibleEvent(ctx context.Context, name string) *domain.Event

GetRepositoryAccessibleEvent creates an event for repository accessibility

func GetRepositoryInaccessibleEvent added in v0.9.0

func GetRepositoryInaccessibleEvent(ctx context.Context, name string, errorMessage string) *domain.Event

GetRepositoryInaccessibleEvent creates an event for repository inaccessibility

func GetResourceCreatedOrUpdatedFailureEvent added in v0.9.0

func GetResourceCreatedOrUpdatedFailureEvent(ctx context.Context, created bool, resourceKind domain.ResourceKind, resourceName string, status domain.Status, updatedDetails *domain.ResourceUpdatedDetails) *domain.Event

GetResourceCreatedOrUpdatedFailureEvent creates an event for failed resource creation or update

func GetResourceCreatedOrUpdatedSuccessEvent added in v0.9.0

func GetResourceCreatedOrUpdatedSuccessEvent(ctx context.Context, created bool, resourceKind domain.ResourceKind, resourceName string, updates *domain.ResourceUpdatedDetails, log logrus.FieldLogger, annotations map[string]string) *domain.Event

GetResourceCreatedOrUpdatedSuccessEvent creates an event for successful resource creation or update

func GetResourceDeletedFailureEvent added in v0.9.0

func GetResourceDeletedFailureEvent(ctx context.Context, resourceKind domain.ResourceKind, resourceName string, status domain.Status) *domain.Event

GetResourceDeletedFailureEvent creates an event for failed resource deletion

func GetResourceDeletedSuccessEvent added in v0.9.0

func GetResourceDeletedSuccessEvent(ctx context.Context, resourceKind domain.ResourceKind, resourceName string) *domain.Event

GetResourceDeletedSuccessEvent creates an event for successful resource deletion

func GetResourceSyncAccessibleEvent added in v0.9.0

func GetResourceSyncAccessibleEvent(ctx context.Context, resourceName string) *domain.Event

func GetResourceSyncCommitDetectedEvent added in v0.9.0

func GetResourceSyncCommitDetectedEvent(ctx context.Context, resourceName string, commitHash string) *domain.Event

ResourceSync event functions

func GetResourceSyncInaccessibleEvent added in v0.9.0

func GetResourceSyncInaccessibleEvent(ctx context.Context, resourceName string, errorMessage string) *domain.Event

func GetResourceSyncParsedEvent added in v0.9.0

func GetResourceSyncParsedEvent(ctx context.Context, resourceName string) *domain.Event

func GetResourceSyncParsingFailedEvent added in v0.9.0

func GetResourceSyncParsingFailedEvent(ctx context.Context, resourceName string, errorMessage string) *domain.Event

func GetResourceSyncSyncFailedEvent added in v0.9.0

func GetResourceSyncSyncFailedEvent(ctx context.Context, resourceName string, errorMessage string) *domain.Event

func GetResourceSyncSyncedEvent added in v0.9.0

func GetResourceSyncSyncedEvent(ctx context.Context, resourceName string) *domain.Event

func GetSystemRestoredEvent added in v0.10.0

func GetSystemRestoredEvent(ctx context.Context, devicesUpdated int64) *domain.Event

GetSystemRestoredEvent creates an event for system restoration completion Associates the event with a system-level resource using the System kind

func KeepDBDeviceStatus added in v0.9.0

func KeepDBDeviceStatus(device, dbDevice *domain.Device)

do not overwrite valid service-side statuses with placeholder device-side status

func UpdateServiceSideStatus added in v0.4.0

func UpdateServiceSideStatus(ctx context.Context, orgId uuid.UUID, device *domain.Device, st store.Store, log logrus.FieldLogger) bool

Types

type DeviceFailureEvent added in v0.9.0

type DeviceFailureEvent func(ctx context.Context, created bool, resourceKind domain.ResourceKind, resourceName string, status domain.Status) *domain.Event

type DeviceSuccessEvent added in v0.9.0

type DeviceSuccessEvent func(ctx context.Context, created bool, resourceKind domain.ResourceKind, resourceName string, updateDetails *domain.ResourceUpdatedDetailsUpdatedFields, log logrus.FieldLogger) *domain.Event

type GetResourceEventFromUpdateDetailsFunc added in v0.9.0

type GetResourceEventFromUpdateDetailsFunc func(ctx context.Context, update ResourceUpdate) *domain.Event

type ResourceUpdate added in v0.9.0

type ResourceUpdate struct {
	Reason  domain.EventReason
	Details string
}

type ResourceUpdates added in v0.9.0

type ResourceUpdates []ResourceUpdate

func ComputeDeviceStatusChanges added in v0.9.0

func ComputeDeviceStatusChanges(ctx context.Context, oldDevice, newDevice *domain.Device, orgId uuid.UUID, st store.Store) ResourceUpdates

Jump to

Keyboard shortcuts

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