mirror of
https://github.com/openziti/ziti.git
synced 2026-10-15 16:41:12 +00:00
Merge pull request #666 from openziti/fix-update-terminator-omit-cost
Fix updating terminators when cost is omitted
This commit is contained in:
@@ -44,7 +44,6 @@ func MapCreateTerminatorToModel(terminator *rest_model.TerminatorCreate) *networ
|
||||
Identity: terminator.Identity,
|
||||
IdentitySecret: terminator.IdentitySecret,
|
||||
Precedence: xt.GetPrecedenceForName(string(terminator.Precedence)),
|
||||
Cost: 0,
|
||||
}
|
||||
|
||||
if terminator.Cost != nil {
|
||||
@@ -65,8 +64,12 @@ func MapUpdateTerminatorToModel(id string, terminator *rest_model.TerminatorUpda
|
||||
Binding: stringz.OrEmpty(terminator.Binding),
|
||||
Address: stringz.OrEmpty(terminator.Address),
|
||||
Precedence: xt.GetPrecedenceForName(string(terminator.Precedence)),
|
||||
Cost: uint16(*terminator.Cost),
|
||||
}
|
||||
|
||||
if terminator.Cost != nil {
|
||||
ret.Cost = uint16(*terminator.Cost)
|
||||
}
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
@@ -81,8 +84,12 @@ func MapPatchTerminatorToModel(id string, terminator *rest_model.TerminatorPatch
|
||||
Binding: terminator.Binding,
|
||||
Address: terminator.Address,
|
||||
Precedence: xt.GetPrecedenceForName(string(terminator.Precedence)),
|
||||
Cost: uint16(*terminator.Cost),
|
||||
}
|
||||
|
||||
if terminator.Cost != nil {
|
||||
ret.Cost = uint16(*terminator.Cost)
|
||||
}
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user