Skip to content

Commit

Permalink
small code improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
lgfa29 committed May 2, 2020
1 parent 6b66023 commit 07659e1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions policy/nomad/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ func parsePolicy(p *api.ScalingPolicy) policy.Policy {
to := policy.Policy{
ID: p.ID,
Max: p.Max,
Enabled: true,
Target: parseTarget(p.Policy[keyTarget], p.Target),
Strategy: parseStrategy(p.Policy[keyStrategy]),
}
Expand All @@ -34,10 +35,7 @@ func parsePolicy(p *api.ScalingPolicy) policy.Policy {
to.Source = source
}

// Policy is enabled by default.
if p.Enabled == nil {
to.Enabled = true
} else {
if p.Enabled != nil {
to.Enabled = *p.Enabled
}

Expand Down

0 comments on commit 07659e1

Please sign in to comment.