Skip to content

Commit

Permalink
Add maximum replicas per node support to stack version 3.8
Browse files Browse the repository at this point in the history
Signed-off-by: Olli Janatuinen <olli.janatuinen@gmail.com>
  • Loading branch information
olljanat committed Jan 14, 2019
1 parent 1b8d1e2 commit 85406d1
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 35 deletions.
1 change: 1 addition & 0 deletions cli/compose/convert/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ func Service(
Placement: &swarm.Placement{
Constraints: service.Deploy.Placement.Constraints,
Preferences: getPlacementPreference(service.Deploy.Placement.Preferences),
MaxReplicas: service.Deploy.Placement.MaxReplicas,
},
},
EndpointSpec: endpoint,
Expand Down
69 changes: 35 additions & 34 deletions cli/compose/schema/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion cli/compose/schema/data/config_schema_v3.8.json
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,8 @@
},
"additionalProperties": false
}
}
},
"max_replicas_per_node": {"type": "integer"}
},
"additionalProperties": false
}
Expand Down
1 change: 1 addition & 0 deletions cli/compose/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ type RestartPolicy struct {
type Placement struct {
Constraints []string `yaml:",omitempty" json:"constraints,omitempty"`
Preferences []PlacementPreferences `yaml:",omitempty" json:"preferences,omitempty"`
MaxReplicas uint64 `yaml:",omitempty" json:"max_replicas_per_node,omitempty"`
}

// PlacementPreferences is the preferences for a service placement
Expand Down

0 comments on commit 85406d1

Please sign in to comment.