Skip to content

Commit

Permalink
Merge f113652 into 82080ea
Browse files Browse the repository at this point in the history
  • Loading branch information
victor-carvalho committed Jul 9, 2020
2 parents 82080ea + f113652 commit 16b8b68
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 13 deletions.
2 changes: 2 additions & 0 deletions helm/charts/maestro-postgres/templates/maestro-postgres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ spec:
value: maestro
- name: POSTGRES_DB
value: maestro
- name: POSTGRES_HOST_AUTH_METHOD
value: trust
livenessProbe:
exec:
command:
Expand Down
2 changes: 1 addition & 1 deletion helm/charts/maestro/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: maestro
home: https://github.com/topfreegames/maestro
description: Maestro api and worker
version: 7.2.2
version: 9.5.1
maintainers:
- name: TFGCo
email: backend@tfgco.com
2 changes: 1 addition & 1 deletion metadata/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
package metadata

//Version of Maestro
var Version = "9.4.1"
var Version = "9.5.2"

//KubeVersion is the desired Kubernetes version
var KubeVersion = "v1.13.9"
24 changes: 13 additions & 11 deletions watcher/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -1262,13 +1262,6 @@ func (w *Watcher) EnsureCorrectRooms() error {

invalidPods := append(incorrectPods, unregisteredPods...)

if len(invalidPods) <= 0 {
// delete invalidRooms key for safety
models.RemoveInvalidRoomsKey(w.RedisClient.Trace(ctx), w.MetricsReporter, w.SchedulerName)
logger.Debug("no invalid pods to replace")
return nil
}

// get operation manager if it exists.
// It won't exist if not in a UpdateSchedulerConfig operation
operationManager, err := w.getOperation(ctx, logger)
Expand All @@ -1289,10 +1282,12 @@ func (w *Watcher) EnsureCorrectRooms() error {
invalidPods = incorrectPods

if status["description"] != models.OpManagerRollingUpdate {
err = models.SetInvalidRooms(w.RedisClient.Trace(ctx), w.MetricsReporter, w.SchedulerName, incorrectPodNames)
if err != nil {
logger.WithError(err).Error("error trying to save invalid rooms to track progress")
return err
if len(invalidPods) > 0 {
err = models.SetInvalidRooms(w.RedisClient.Trace(ctx), w.MetricsReporter, w.SchedulerName, incorrectPodNames)
if err != nil {
logger.WithError(err).Error("error trying to save invalid rooms to track progress")
return err
}
}
err = operationManager.SetDescription(models.OpManagerRollingUpdate)
if err != nil {
Expand All @@ -1302,6 +1297,13 @@ func (w *Watcher) EnsureCorrectRooms() error {
}
}

if len(invalidPods) <= 0 {
// delete invalidRooms key for safety
models.RemoveInvalidRoomsKey(w.RedisClient.Trace(ctx), w.MetricsReporter, w.SchedulerName)
logger.Debug("no invalid pods to replace")
return nil
}

// replace invalid pods using rolling strategy
timeoutSec := w.Config.GetInt("updateTimeoutSeconds")
timeoutDur := time.Duration(timeoutSec) * time.Second
Expand Down
3 changes: 3 additions & 0 deletions watcher/watcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,9 @@ var _ = Describe("Watcher", func() {
w.Run = false
}, mockDb, nil, nil)

opManager := models.NewOperationManager(configYaml.Name, mockRedisClient, logger)
testing.MockGetCurrentOperationKey(opManager, mockRedisClient, nil)

mockRedisClient.EXPECT().TxPipeline().Return(mockPipeline)
mockPipeline.EXPECT().Del(models.GetInvalidRoomsKey(configYaml.Name))
mockPipeline.EXPECT().Exec()
Expand Down

0 comments on commit 16b8b68

Please sign in to comment.