Skip to content

Commit

Permalink
adjust log level of some rather important messages
Browse files Browse the repository at this point in the history
  • Loading branch information
tremes committed Jan 30, 2024
1 parent 226e253 commit aa18fc3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions pkg/controller/periodic/periodic.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func (c *Controller) Run(stopCh <-chan struct{}, initialDelay time.Duration) {
// Gather Runs the gatherers one after the other.
func (c *Controller) Gather() {
if c.isGatheringDisabled() {
klog.V(3).Info("Gather is disabled by configuration.")
klog.Info("Gather is disabled by configuration.")
return
}

Expand Down Expand Up @@ -301,7 +301,7 @@ func (c *Controller) onDemandGather(stopCh <-chan struct{}) {

func (c *Controller) GatherJob() {
if c.isGatheringDisabled() {
klog.V(3).Info("Gather is disabled by configuration.")
klog.Info("Gather is disabled by configuration.")
return
}
ctx, cancel := context.WithTimeout(context.Background(), c.configAggregator.Config().DataReporting.Interval*4)
Expand Down
18 changes: 9 additions & 9 deletions pkg/controller/status/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,28 +213,28 @@ func (c *Controller) currentControllerStatus() (allReady bool) { //nolint: gocyc

if summary.Operation.Name == controllerstatus.Uploading.Name {
if summary.Count < uploadFailuresCountThreshold {
klog.V(4).Infof("Number of last upload failures %d lower than threshold %d. Not marking as degraded.",
klog.Infof("Number of last upload failures %d lower than threshold %d. Not marking as degraded.",
summary.Count, uploadFailuresCountThreshold)
} else {
degradingFailure = true
klog.V(4).Infof("Number of last upload failures %d exceeded the threshold %d. Marking as degraded.",
klog.Infof("Number of last upload failures %d exceeded the threshold %d. Marking as degraded.",
summary.Count, uploadFailuresCountThreshold)
}
c.ctrlStatus.setStatus(UploadStatus, summary.Reason, summary.Message)
} else if summary.Operation.Name == controllerstatus.DownloadingReport.Name {
klog.V(4).Info("Failed to download Insights report")
klog.Info("Failed to download Insights report")
c.ctrlStatus.setStatus(DownloadStatus, summary.Reason, summary.Message)
} else if summary.Operation.Name == controllerstatus.PullingSCACerts.Name {
// mark as degraded only in case of HTTP 500 and higher
if summary.Operation.HTTPStatusCode >= 500 {
klog.V(4).Infof("Failed to download the SCA certs within the threshold %d with exponential backoff. Marking as degraded.",
klog.Infof("Failed to download the SCA certs within the threshold %d with exponential backoff. Marking as degraded.",
ocm.FailureCountThreshold)
degradingFailure = true
}
} else if summary.Operation.Name == controllerstatus.PullingClusterTransfer.Name {
// mark as degraded only in case of HTTP 500 and higher
if summary.Operation.HTTPStatusCode >= 500 {
klog.V(4).Infof("Failed to pull the cluster transfer object within the threshold %d with exponential backoff. Marking as degraded.",
klog.Infof("Failed to pull the cluster transfer object within the threshold %d with exponential backoff. Marking as degraded.",
ocm.FailureCountThreshold)
degradingFailure = true
}
Expand Down Expand Up @@ -416,7 +416,7 @@ func (c *Controller) checkDisabledGathering() {
// update the current controller state by it status
func (c *Controller) updateControllerConditionsByStatus(cs *conditions, isInitializing bool) {
if isInitializing {
klog.V(4).Infof("The operator is still being initialized")
klog.Infof("The operator is still being initialized")
// if we're still starting up and some sources are not ready, initialize the conditions
// but don't update
if !cs.hasCondition(configv1.OperatorProgressing) {
Expand All @@ -425,7 +425,7 @@ func (c *Controller) updateControllerConditionsByStatus(cs *conditions, isInitia
}

if es := c.ctrlStatus.getStatus(ErrorStatus); es != nil && !c.ctrlStatus.isDisabled() {
klog.V(4).Infof("The operator has some internal errors: %s", es.message)
klog.Infof("The operator has some internal errors: %s", es.message)
cs.setCondition(configv1.OperatorProgressing, configv1.ConditionFalse, degradedReason, "An error has occurred")
cs.setCondition(configv1.OperatorAvailable, configv1.ConditionFalse, es.reason, es.message)
cs.setCondition(configv1.OperatorUpgradeable, configv1.ConditionFalse, degradedReason, es.message)
Expand All @@ -434,14 +434,14 @@ func (c *Controller) updateControllerConditionsByStatus(cs *conditions, isInitia
// when the operator is already healthy then it doesn't make sense to set those, but when it's degraded and then
// marked as disabled then it's reasonable to set Available=True
if ds := c.ctrlStatus.getStatus(DisabledStatus); ds != nil && !c.ctrlStatus.isHealthy() {
klog.V(4).Infof("The operator is marked as disabled")
klog.Infof("The operator is marked as disabled")
cs.setCondition(configv1.OperatorProgressing, configv1.ConditionFalse, asExpectedReason, monitoringMsg)
cs.setCondition(configv1.OperatorAvailable, configv1.ConditionTrue, asExpectedReason, insightsAvailableMessage)
cs.setCondition(configv1.OperatorUpgradeable, configv1.ConditionTrue, upgradeableReason, canBeUpgradedMsg)
}

if c.ctrlStatus.isHealthy() {
klog.V(4).Infof("The operator is healthy")
klog.Infof("The operator is healthy")
cs.setCondition(configv1.OperatorProgressing, configv1.ConditionFalse, asExpectedReason, monitoringMsg)
cs.setCondition(configv1.OperatorAvailable, configv1.ConditionTrue, asExpectedReason, insightsAvailableMessage)
cs.setCondition(configv1.OperatorUpgradeable, configv1.ConditionTrue, upgradeableReason, canBeUpgradedMsg)
Expand Down

0 comments on commit aa18fc3

Please sign in to comment.