mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
Parse test for spread
This commit is contained in:
@@ -55,6 +55,23 @@ func TestParse(t *testing.T) {
|
||||
},
|
||||
},
|
||||
|
||||
Spreads: []*api.Spread{
|
||||
{
|
||||
Attribute: "${meta.rack}",
|
||||
Weight: 100,
|
||||
SpreadTarget: []*api.SpreadTarget{
|
||||
{
|
||||
Value: "r1",
|
||||
Percent: 40,
|
||||
},
|
||||
{
|
||||
Value: "r2",
|
||||
Percent: 60,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Update: &api.UpdateStrategy{
|
||||
Stagger: helper.TimeToPtr(60 * time.Second),
|
||||
MaxParallel: helper.IntToPtr(2),
|
||||
@@ -112,6 +129,26 @@ func TestParse(t *testing.T) {
|
||||
Delay: helper.TimeToPtr(15 * time.Second),
|
||||
Mode: helper.StringToPtr("delay"),
|
||||
},
|
||||
Spreads: []*api.Spread{
|
||||
{
|
||||
Attribute: "${node.datacenter}",
|
||||
Weight: 50,
|
||||
SpreadTarget: []*api.SpreadTarget{
|
||||
{
|
||||
Value: "dc1",
|
||||
Percent: 50,
|
||||
},
|
||||
{
|
||||
Value: "dc2",
|
||||
Percent: 25,
|
||||
},
|
||||
{
|
||||
Value: "dc3",
|
||||
Percent: 25,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
ReschedulePolicy: &api.ReschedulePolicy{
|
||||
Interval: helper.TimeToPtr(12 * time.Hour),
|
||||
Attempts: helper.IntToPtr(5),
|
||||
|
||||
Reference in New Issue
Block a user