Documentation ¶
Index ¶
- Constants
- func CreateDataGatherGathererStatus(gfr *gather.GathererFunctionReport) v1alpha1.GathererStatus
- func CreateOperatorGathererStatus(gfr *gather.GathererFunctionReport) v1.GathererStatus
- func DataGatherStatusToOperatorStatus(dg *v1alpha1.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 *insightsv1alpha1.DataGather, conType string) *metav1.Condition
- func RemoteConfigurationInvalidCondition(status metav1.ConditionStatus, reason, message string) metav1.Condition
- func RemoteConfigurationNotAvailableCondition(status metav1.ConditionStatus, reason, message string) metav1.Condition
- func UpdateDataGatherConditions(ctx context.Context, ...) (*insightsv1alpha1.DataGather, error)
- func UpdateDataGatherState(ctx context.Context, ...) (*insightsv1alpha1.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" )
const ( DataUploaded = "DataUploaded" DataRecorded = "DataRecorded" DataProcessed = "DataProcessed" NoUploadYetReason = "NoUploadYet" NoDataGatheringYetReason = "NoDataGatheringYet" NothingToProcessYetReason = "NothingToProcessYet" RemoteConfNotValidatedYet = "NoValidationYet" RemoteConfNotRequestedYet = "RemoteConfigNotRequestedYet" UnknownReason = "Unknown" )
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" )
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 ¶
func UpdateDataGatherState(ctx context.Context, insightsClient insightsv1alpha1cli.InsightsV1alpha1Interface, dataGatherCR *insightsv1alpha1.DataGather, newState insightsv1alpha1.DataGatherState) (*insightsv1alpha1.DataGather, error)
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 (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.