Add nancy vulnerability scanner (#10289)

This commit is contained in:
Harshavardhana
2020-08-19 14:25:21 -07:00
committed by GitHub
parent 3acb5cff45
commit c8b84a0e9e
7 changed files with 92 additions and 53 deletions

View File

@@ -20,6 +20,7 @@ import (
"encoding/xml"
"io"
"sort"
"strconv"
"strings"
)
@@ -100,10 +101,10 @@ func (c Config) Validate(bucket string, sameTarget bool) error {
if err := r.Validate(bucket, sameTarget); err != nil {
return err
}
if _, ok := priorityMap[string(r.Priority)]; ok {
if _, ok := priorityMap[strconv.Itoa(r.Priority)]; ok {
return errReplicationUniquePriority
}
priorityMap[string(r.Priority)] = struct{}{}
priorityMap[strconv.Itoa(r.Priority)] = struct{}{}
}
return nil
}