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 9c756f9 commit 2675841
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const (
DefaultIngressThreads = 10

// DefaultLeaderElect is the default true leader election should be enabled
DefaultLeaderElect = true
DefaultLeaderElect = false

// DefaultLeaderElectionLeaseDuration is the default time in seconds that non-leader candidates will wait to force acquire leadership
DefaultLeaderElectionLeaseDuration = 15 * time.Second
Expand Down
8 changes: 7 additions & 1 deletion rollout/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ func NewController(cfg ControllerConfig) *Controller {
controller.enqueueRollout(obj)
ro := unstructuredutil.ObjectToRollout(obj)
if ro != nil {
logCtx := logutil.WithRollout(ro)
logCtx.Info("rollout enqueue due to add event")
if cfg.Recorder != nil {
cfg.Recorder.Eventf(ro, record.EventOptions{
EventType: corev1.EventTypeNormal,
Expand All @@ -258,12 +260,16 @@ func NewController(cfg ControllerConfig) *Controller {
controller.IstioController.EnqueueDestinationRule(key)
}
}
if newRollout != nil {
logCtx := logutil.WithRollout(newRollout)
logCtx.Info("rollout enqueue due to update event")
}
controller.enqueueRollout(new)
},
DeleteFunc: func(obj interface{}) {
if ro := unstructuredutil.ObjectToRollout(obj); ro != nil {
logCtx := logutil.WithRollout(ro)
logCtx.Info("rollout deleted")
logCtx.Info("rollout enqueue due to delete event")
controller.metricsServer.Remove(ro.Namespace, ro.Name, logutil.RolloutKey)
// Rollout is deleted, queue up the referenced Service and/or DestinationRules so
// that the rollouts-pod-template-hash can be cleared from each
Expand Down
6 changes: 4 additions & 2 deletions rollout/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -828,11 +828,13 @@ func (c *rolloutContext) requeueStuckRollout(newStatus v1alpha1.RolloutStatus) t
// Make it ratelimited so we stay on the safe side, eventually the Deployment should
// transition either to a Complete or to a TimedOut condition.
if after < time.Second {
c.log.Infof("Queueing up Rollout for a progress check now")
logCtx := logutil.WithRollout(c.rollout)
logCtx.Info("rollout enqueue due to stuck event")
c.enqueueRollout(c.rollout)
return time.Duration(0)
}
c.log.Infof("Queueing up rollout for a progress after %ds", int(after.Seconds()))
logCtx := logutil.WithRollout(c.rollout)
logCtx.Info("Queueing up rollout for a progress after %ds", int(after.Seconds()))

Check failure on line 837 in rollout/sync.go

View workflow job for this annotation

GitHub Actions / Lint Go code

printf: (*github.com/sirupsen/logrus.Entry).Info call has possible Printf formatting directive %d (govet)

Check failure on line 837 in rollout/sync.go

View workflow job for this annotation

GitHub Actions / Build

(*github.com/sirupsen/logrus.Entry).Info call has possible formatting directive %d

Check failure on line 837 in rollout/sync.go

View workflow job for this annotation

GitHub Actions / Build

(*github.com/sirupsen/logrus.Entry).Info call has possible formatting directive %d
// Add a second to avoid milliseconds skew in AddAfter.
// See https://github.com/kubernetes/kubernetes/issues/39785#issuecomment-279959133 for more info.
c.enqueueRolloutAfter(c.rollout, after+time.Second)
Expand Down

0 comments on commit 2675841

Please sign in to comment.