status

package
v0.0.0-...-c46c8bf Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: Apache-2.0 Imports: 25 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"
)
View Source
const (
	DataUploaded  = "DataUploaded"
	DataRecorded  = "DataRecorded"
	DataProcessed = "DataProcessed"

	NoUploadYetReason         = "NoUploadYet"
	NoDataGatheringYetReason  = "NoDataGatheringYet"
	NothingToProcessYetReason = "NothingToProcessYet"
	RemoteConfNotValidatedYet = "NoValidationYet"
	RemoteConfNotRequestedYet = "RemoteConfigNotRequestedYet"
	UnknownReason             = "Unknown"
)
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"
)
View Source
const (
	AsExpectedReason = "AsExpected"
)

Variables

This section is empty.

Functions

func CreateDataGatherGathererStatus

func CreateDataGatherGathererStatus(gfr *gather.GathererFunctionReport) v1alpha1.GathererStatus

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 *v1alpha1.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 *insightsv1alpha1.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 RemoteConfigurationInvalidCondition

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

RemoteConfigurationInvalidCondition retunrs new "RemoteConfigurationInvalid" status condition with provided status, reason and message

func RemoteConfigurationNotAvailableCondition

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

RemoteConfigurationNotAvailableCondition retunrs new "RemoteConfigurationNotAvailable" status condition with provided status, reason and message

func UpdateDataGatherConditions

func UpdateDataGatherConditions(ctx context.Context,
	insightsClient insightsv1alpha1cli.InsightsV1alpha1Interface,
	dataGather *insightsv1alpha1.DataGather, condition *metav1.Condition) (*insightsv1alpha1.DataGather, error)

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

func UpdateDataGatherState

UpdateDataGatherState updates status' time attributes, state and conditions of the provided DataGather resource

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) *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