Skip to content

Commit

Permalink
feat: release-1.6 logs for priceline
Browse files Browse the repository at this point in the history
  • Loading branch information
pasha-codefresh committed Jan 12, 2024
1 parent 82d8038 commit 511f434
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rollout/context.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package rollout

import (
logutil "github.com/argoproj/argo-rollouts/utils/log"

Check failure on line 4 in rollout/context.go

View workflow job for this annotation

GitHub Actions / Lint Go code

File is not `goimports`-ed (goimports)
"time"

log "github.com/sirupsen/logrus"
Expand Down Expand Up @@ -56,6 +57,8 @@ func (c *rolloutContext) reconcile() error {
err := c.getRolloutValidationErrors()
if err != nil {
if vErr, ok := err.(*field.Error); ok {
logCtx := logutil.WithRollout(c.rollout)
logCtx.Info("rollout enqueue due reconcile error")
// We want to frequently requeue rollouts with InvalidSpec errors, because the error
// condition might be timing related (e.g. the Rollout was applied before the Service).
c.enqueueRolloutAfter(c.rollout, 20*time.Second)
Expand Down
5 changes: 5 additions & 0 deletions rollout/pause.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package rollout

import (
logutil "github.com/argoproj/argo-rollouts/utils/log"

Check failure on line 4 in rollout/pause.go

View workflow job for this annotation

GitHub Actions / Lint Go code

File is not `goimports`-ed (goimports)
"time"

log "github.com/sirupsen/logrus"
Expand Down Expand Up @@ -209,6 +210,10 @@ func (c *rolloutContext) checkEnqueueRolloutDuringWait(startTime metav1.Time, du
if nextResync.After(expiredTime) && expiredTime.After(now.Time) {
timeRemaining := expiredTime.Sub(now.Time)
c.log.Infof("Enqueueing Rollout in %s seconds", timeRemaining.String())

logCtx := logutil.WithRollout(c.rollout)
logCtx.Info("rollout enqueue during wait")

c.enqueueRolloutAfter(c.rollout, timeRemaining)
}
}
7 changes: 7 additions & 0 deletions rollout/replicaset.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package rollout
import (
"context"
"fmt"
logutil "github.com/argoproj/argo-rollouts/utils/log"

Check failure on line 6 in rollout/replicaset.go

View workflow job for this annotation

GitHub Actions / Lint Go code

File is not `goimports`-ed (goimports)
"sort"
"time"

Expand Down Expand Up @@ -150,6 +151,8 @@ func (c *rolloutContext) reconcileNewReplicaSet() (bool, error) {
c.log.Infof("RS '%s' has not reached the scaleDownTime", c.newRS.Name)
remainingTime := scaleDownAt.Sub(now.Time)
if remainingTime < c.resyncPeriod {
logCtx := logutil.WithRollout(c.rollout)
logCtx.Info("rollout enqueue due to scaleDownDelay")
c.enqueueRolloutAfter(c.rollout, remainingTime)
return false, nil
}
Expand Down Expand Up @@ -284,6 +287,8 @@ func (c *rolloutContext) scaleDownDelayHelper(rs *appsv1.ReplicaSet, annotatione
if err != nil {
return annotationedRSs, desiredReplicaCount, err
}
logCtx := logutil.WithRollout(c.rollout)
logCtx.Info("rollout enqueue due to scaleDownDelay v2")
c.enqueueRolloutAfter(c.rollout, scaleDownDelaySeconds)
}
} else if replicasetutil.HasScaleDownDeadline(rs) {
Expand All @@ -297,6 +302,8 @@ func (c *rolloutContext) scaleDownDelayHelper(rs *appsv1.ReplicaSet, annotatione
} else if remainingTime != nil {
c.log.Infof("RS '%s' has not reached the scaleDownTime", rs.Name)
if *remainingTime < c.resyncPeriod {
logCtx := logutil.WithRollout(c.rollout)
logCtx.Info("rollout enqueue due to scaleDownDelay v3")
c.enqueueRolloutAfter(c.rollout, *remainingTime)
}
desiredReplicaCount = rolloutReplicas
Expand Down
2 changes: 2 additions & 0 deletions rollout/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ func (c *rolloutContext) awsVerifyTargetGroups(svc *corev1.Service) error {
}
if !verifyRes.Verified {
c.recorder.Warnf(c.rollout, record.EventOptions{EventReason: conditions.TargetGroupUnverifiedReason}, conditions.TargetGroupUnverifiedRegistrationMessage, svc.Name, tgb.Spec.TargetGroupARN, verifyRes.EndpointsRegistered, verifyRes.EndpointsTotal)
logCtx := logutil.WithRollout(c.rollout)
logCtx.Info("rollout enqueue due to awsVerifyTargetGroups")
c.enqueueRolloutAfter(c.rollout, defaults.GetRolloutVerifyRetryInterval())
return nil
}
Expand Down
3 changes: 3 additions & 0 deletions rollout/trafficrouting.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package rollout

import (
"fmt"
logutil "github.com/argoproj/argo-rollouts/utils/log"
"reflect"
"strconv"
"strings"
Expand Down Expand Up @@ -283,6 +284,8 @@ func (c *rolloutContext) reconcileTrafficRouting() error {
c.log.Infof("Desired weight (stepIdx: %s) %d verified", indexString, desiredWeight)
} else {
c.log.Infof("Desired weight (stepIdx: %s) %d not yet verified", indexString, desiredWeight)
logCtx := logutil.WithRollout(c.rollout)
logCtx.Info("rollout enqueue due to trafficrouting")
c.enqueueRolloutAfter(c.rollout, defaults.GetRolloutVerifyRetryInterval())
}
}
Expand Down

0 comments on commit 511f434

Please sign in to comment.