Skip to content

Commit

Permalink
Merge c7e7611 into c5e931b
Browse files Browse the repository at this point in the history
  • Loading branch information
jdef committed Sep 6, 2018
2 parents c5e931b + c7e7611 commit 47500b6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions api/v1/lib/extras/scheduler/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,20 @@ type (
handler events.Handler
registrationTokens <-chan struct{}
subscriptionTerminated func(error)
initSuppressRoles []string
}
)

// WithInitiallySuppressedRoles sets the "suppressed_roles" field of the SUBSCRIBE call
// that's issued to Mesos for each (re-)subscription attempt.
func WithInitiallySuppressedRoles(r []string) Option {
return func(c *Config) Option {
old := c.initSuppressRoles
c.initSuppressRoles = r
return WithInitiallySuppressedRoles(old)
}
}

// WithEventHandler sets the consumer of scheduler events. The controller's internal event processing
// loop is aborted if a Handler returns a non-nil error, after which the controller may attempt
// to re-register (subscribe) with Mesos.
Expand Down Expand Up @@ -99,6 +110,7 @@ func Run(ctx context.Context, framework *mesos.FrameworkInfo, caller calls.Calle
config.handler = DefaultHandler
}
subscribe := calls.Subscribe(framework)
subscribe.Subscribe.SuppressedRoles = config.initSuppressRoles
for !isDone(ctx) {
frameworkID := config.tryFrameworkID()
if framework.GetFailoverTimeout() > 0 && frameworkID != "" {
Expand Down

0 comments on commit 47500b6

Please sign in to comment.