summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--table/policy.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/table/policy.go b/table/policy.go
index 7369a823..6bcaa5fe 100644
--- a/table/policy.go
+++ b/table/policy.go
@@ -2366,7 +2366,10 @@ func NewPolicyFromApiStruct(a *api.Policy, dmap DefinedSetMap) (*Policy, error)
return nil, fmt.Errorf("empty policy name")
}
stmts := make([]*Statement, 0, len(a.Statements))
- for _, x := range a.Statements {
+ for idx, x := range a.Statements {
+ if x.Name == "" {
+ x.Name = fmt.Sprintf("%s_stmt%d", a.Name, idx)
+ }
y, err := NewStatementFromApiStruct(x, dmap)
if err != nil {
return nil, err