Documentation
¶
Index ¶
- Constants
- func CreateDataGatherGathererStatus(report *gather.GathererFunctionReport) (*insightsv1.GathererStatus, error)
- func CreateOperatorGathererStatus(gfr *gather.GathererFunctionReport) v1.GathererStatus
- func DataGatherStatusToOperatorStatus(dg *insightsv1.DataGather) v1.InsightsOperatorStatus
- func DataProcessedCondition(status metav1.ConditionStatus, reason, message string) metav1.Condition
- func DataRecordedCondition(status metav1.ConditionStatus, reason, message string) metav1.Condition
- func DataUploadedCondition(status metav1.ConditionStatus, reason, message string) metav1.Condition
- func GetConditionByType(dataGather *insightsv1.DataGather, conType string) *metav1.Condition
- func Int32ToTotalRisk(totalRisk int32) insightsv1.TotalRisk
- func ProgressingCondition(gatheringReason string) metav1.Condition
- func RemoteConfigurationAvailableCondition(status metav1.ConditionStatus, reason, message string) metav1.Condition
- func RemoteConfigurationValidCondition(status metav1.ConditionStatus, reason, message string) metav1.Condition
- func UpdateDataGatherConditions(ctx context.Context, insightsClient insightsv1client.InsightsV1Interface, ...) (*insightsv1.DataGather, error)
- func UpdateProgressingCondition(ctx context.Context, insightsClient insightsv1client.InsightsV1Interface, ...) (*insightsv1.DataGather, error)
- type Controller
- func (c *Controller) AddSources(sources ...controllerstatus.StatusController)
- func (c *Controller) LastReportedTime() time.Time
- func (c *Controller) SetLastReportedTime(at time.Time)
- func (c *Controller) Source(name string) controllerstatus.StatusController
- func (c *Controller) Sources() map[string]controllerstatus.StatusController
- func (c *Controller) Start(ctx context.Context) error
- type Reported
Constants ¶
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" )
const ( // Condition reasons AsExpectedReason = "AsExpected" SucceededReason = "Succeeded" FailedReason = "Failed" )
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." )
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" )
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 ¶
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 (c *Controller) Source(name string) controllerstatus.StatusController
func (*Controller) Sources ¶
func (c *Controller) Sources() map[string]controllerstatus.StatusController
Sources provides the sources in a thread-safe way. A source is used to monitor parts of the operator.