diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-04-20 08:50:03 +0000 |
---|---|---|
committer | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-04-20 09:17:22 +0000 |
commit | e55122db0becb2edcd592eed4abc95348d30d9d1 (patch) | |
tree | 2df2cfa957898f0ce7b89be182759f501b3327b5 | |
parent | 733b05b83185d3c1dd0c783462d91a10400c0ae2 (diff) |
policy: check duplicated policy name
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
-rw-r--r-- | table/policy.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/table/policy.go b/table/policy.go index 66416931..acec2980 100644 --- a/table/policy.go +++ b/table/policy.go @@ -2804,6 +2804,9 @@ func (r *RoutingPolicy) Reload(c config.RoutingPolicy) error { if err != nil { return err } + if _, ok := pmap[y.Name()]; ok { + return fmt.Errorf("duplicated policy name. policy name must be unique.") + } pmap[y.Name()] = y for _, s := range y.Statements { _, ok := smap[s.Name] |