Skip to content

Commit

Permalink
feat(hatchery/marathon): allow to set uris for new applications (#5910)
Browse files Browse the repository at this point in the history
  • Loading branch information
richardlt authored Aug 31, 2021
1 parent bbae9de commit de71b22
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions engine/hatchery/marathon/marathon.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,10 @@ func (h *HatcheryMarathon) SpawnWorker(ctx context.Context, spawnArgs hatchery.S
Labels: &h.marathonLabels,
}

if h.Config.MarathonApplicationURIs != nil && len(h.Config.MarathonApplicationURIs) > 0 {
application.Uris = &h.Config.MarathonApplicationURIs
}

_, next := telemetry.Span(ctx, "marathonClient.CreateApplication")
if _, err := h.marathonClient.CreateApplication(application); err != nil {
next()
Expand Down
3 changes: 3 additions & 0 deletions engine/hatchery/marathon/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ type HatcheryConfiguration struct {

// WorkerSpawnTimeout Worker Timeout Spawning (seconds)
WorkerSpawnTimeout int `mapstructure:"workerSpawnTimeout" toml:"workerSpawnTimeout" default:"120" commented:"false" comment:"Worker Timeout Spawning (seconds)" json:"workerSpawnTimeout"`

// MarathonApplicationURIs will set "uris" value for each Application
MarathonApplicationURIs []string `mapstructure:"applicationURIs" toml:"applicationURIs" commented:"true" comment:"Use this option if you want to add uris on workers spawned by this hatchery." json:"-"`
}

// HatcheryMarathon implements HatcheryMode interface for mesos mode
Expand Down

0 comments on commit de71b22

Please sign in to comment.