status

package
v0.0.0-...-222d95b Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// OperatorDisabled defines the condition type when the operator's primary function has been disabled
	OperatorDisabled configv1.ClusterStatusConditionType = "Disabled"
	// InsightsUploadDegraded defines the condition type (when set to True) when an archive can't be successfully uploaded
	InsightsUploadDegraded configv1.ClusterStatusConditionType = "UploadDegraded"
	// InsightsDownloadDegraded defines the condition type (when set to True) when the Insights report can't be successfully downloaded
	InsightsDownloadDegraded configv1.ClusterStatusConditionType = "InsightsDownloadDegraded"
	// ClusterTransferAvailable is a condition type providing info about ClusterTransfer controller status
	ClusterTransferAvailable configv1.ClusterStatusConditionType = "ClusterTransferAvailable"
	// SCAAvailable is a condition type providing info about SCA controller status
	SCAAvailable configv1.ClusterStatusConditionType = "SCAAvailable"
	// RemoteConfigurationAvailable is a condition type providing info about remote configuration (conditional gathering)
	// availability
	RemoteConfigurationAvailable configv1.ClusterStatusConditionType = "RemoteConfigurationAvailable"
	// RemoteConfigurationInvalid is a condition type providing info about remote configuration content validity
	RemoteConfigurationValid configv1.ClusterStatusConditionType = "RemoteConfigurationValid"
	// GatheringDisabled is a condition providing information about the disabling of gathering with the API.
	GatheringDisabled configv1.ClusterStatusConditionType = "GatheringDisabled"
)
View Source
const (

	// Condition reasons
	AsExpectedReason = "AsExpected"
	SucceededReason  = "Succeeded"
	FailedReason     = "Failed"
)
View Source
const (
	// DataUploaded Condition
	DataUploaded             = "DataUploaded"
	NoUploadYetReason        = "NoUploadYet"
	NoDataGatheringYetReason = "NoDataGatheringYet"

	// DataRecorded Condition
	DataRecorded          = "DataRecorded"
	RecordingFailedReason = "RecordingFailed"

	// DataProcessed Condition
	DataProcessed             = "DataProcessed"
	NothingToProcessYetReason = "NothingToProcessYet"
	ProcessedReason           = "Processed"

	// RemoteConfiguration Condition
	RemoteConfNotValidatedYet = "NoValidationYet"
	RemoteConfNotRequestedYet = "RemoteConfigNotRequestedYet"
	UnknownReason             = "Unknown"

	// Progressing Condition
	Progressing                 = "Progressing"
	DataGatheringPendingReason  = "DataGatherPending"
	DataGatheringPendingMessage = "The gathering has not started yet"
	GatheringReason             = "Gathering"
	GatheringMessage            = "The gathering is running"
	GatheringSucceededReason    = "GatheringSucceeded"
	GatheringSucceededMessage   = "The gathering successfully finished."
	GatheringFailedReason       = "GatheringFailed"
	GatheringFailedMessage      = "The gathering failed."
)
View Source
const (
	DataGatheredCondition = "DataGathered"
	// NoDataGatheredReason is a reason when there is no data gathered - e.g the resource is not in a cluster
	NoDataGatheredReason = "NoData"
	// GatherErrorReason is a reason when there is some error and no data gathered
	GatherErrorReason = "GatherError"
	// GatherPanicReason is a reason when there is some error and no data gathered
	GatherPanicReason = "GatherPanic"
	// GatheredOKReason is a reason when data is gathered as expected
	GatheredOKReason = "GatheredOK"
	// GatheredWithErrorReason is a reason when data is gathered partially or with another error message
	GatheredWithErrorReason = "GatheredWithError"
)
View Source
const (
	DisabledStatus              = "disabled"
	UploadStatus                = "upload"
	DownloadStatus              = "download"
	ErrorStatus                 = "error"
	RemoteConfigAvailableStatus = "remoteConfigAvailable"
	RemoteConfigValidStatus     = "remoteConfigIValid"
)

Variables

This section is empty.

Functions

func CreateDataGatherGathererStatus

func CreateDataGatherGathererStatus(report *gather.GathererFunctionReport) (*insightsv1.GathererStatus, error)

CreateDataGatherGathererStatus creates GathererStatus attribute for the "datagather.insights.openshift.io" custom resource type.

func CreateOperatorGathererStatus

func CreateOperatorGathererStatus(gfr *gather.GathererFunctionReport) v1.GathererStatus

CreateOperatorGathererStatus creates GathererStatus attribute for the "insightsoperator.operator.openshift.io" custom resource type.

func DataGatherStatusToOperatorStatus

func DataGatherStatusToOperatorStatus(dg *insightsv1.DataGather) v1.InsightsOperatorStatus

DataGatherStatusToOperatorStatus copies "DataGatherStatus" from "datagather.openshift.io" and creates "Status" for "insightsoperator.operator.openshift.io"

func DataProcessedCondition

func DataProcessedCondition(status metav1.ConditionStatus, reason, message string) metav1.Condition

DataProcessedCondition returns new "DataProcessed" status condition with provided status, reason and message

func DataRecordedCondition

func DataRecordedCondition(status metav1.ConditionStatus, reason, message string) metav1.Condition

DataRecordedCondition returns new "DataRecorded" status condition with provided status, reason and message

func DataUploadedCondition

func DataUploadedCondition(status metav1.ConditionStatus, reason, message string) metav1.Condition

DataUploadedCondition returns new "DataUploaded" status condition with provided status, reason and message

func GetConditionByType

func GetConditionByType(dataGather *insightsv1.DataGather, conType string) *metav1.Condition

GetConditionByType tries to get the condition with the provided condition status from the provided "datagather" resource. Returns nil when no condition is found.

func Int32ToTotalRisk

func Int32ToTotalRisk(totalRisk int32) insightsv1.TotalRisk

func ProgressingCondition

func ProgressingCondition(gatheringReason string) metav1.Condition

ProgressingCondition returns new "ProgressingCondition" status condition with provided status, reason and message

func RemoteConfigurationAvailableCondition

func RemoteConfigurationAvailableCondition(status metav1.ConditionStatus, reason, message string) metav1.Condition

RemoteConfigurationAvailableCondition returns new "RemoteConfigurationAvailable" status condition with provided status, reason and message

func RemoteConfigurationValidCondition

func RemoteConfigurationValidCondition(status metav1.ConditionStatus, reason, message string) metav1.Condition

RemoteConfigurationValidCondition returns new "RemoteConfigurationValid" status condition with provided status, reason and message

func UpdateDataGatherConditions

func UpdateDataGatherConditions(
	ctx context.Context,
	insightsClient insightsv1client.InsightsV1Interface,
	dataGather *insightsv1.DataGather,
	conditions ...metav1.Condition,
) (*insightsv1.DataGather, error)

UpdateDataGatherConditions updates the conditions of the provided dataGather resource with provided condition

func UpdateProgressingCondition

func UpdateProgressingCondition(ctx context.Context,
	insightsClient insightsv1client.InsightsV1Interface,
	dataGatherCR *insightsv1.DataGather,
	dataGatherName string,
	gatheringState string,
) (*insightsv1.DataGather, error)

UpdateProgressingCondition updates the "Progressing" condition of a DataGather resource based on the current gathering state. It also manages the StartTime and FinishTime timestamps in the DataGather status.

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

Controller is the type responsible for managing the statusMessage of the operator according to the statusMessage of the sources. Sources come from different major parts of the codebase, for the purpose of communicating their statusMessage with the controller.

func NewController

func NewController(
	client configv1client.ConfigV1Interface,
	configurator configobserver.Interface,
	apiConfigurator configobserver.InsightsDataGatherObserver,
	namespace string,
	isTechPreview bool,
	eventLogger events.Recorder,
) *Controller

NewController creates a statusMessage controller, responsible for monitoring the operators statusMessage and updating its cluster statusMessage accordingly.

func (*Controller) AddSources

func (c *Controller) AddSources(sources ...controllerstatus.StatusController)

AddSources adds sources in a thread-safe way. A source is used to monitor parts of the operator.

func (*Controller) LastReportedTime

func (c *Controller) LastReportedTime() time.Time

LastReportedTime provides the last reported time in a thread-safe way.

func (*Controller) SetLastReportedTime

func (c *Controller) SetLastReportedTime(at time.Time)

SetLastReportedTime sets the last reported time in a thread-safe way.

func (*Controller) Source

func (*Controller) Sources

Sources provides the sources in a thread-safe way. A source is used to monitor parts of the operator.

func (*Controller) Start

func (c *Controller) Start(ctx context.Context) error

Start starts the periodic checking of sources.

type Reported

type Reported struct {
	LastReportTime metav1.Time `json:"lastReportTime"`
}

Jump to

Keyboard shortcuts

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