[#216] Add check tag key uniqueness

Signed-off-by: Roman Loginov <r.loginov@yadro.com>
This commit is contained in:
Roman Loginov 2023-10-10 16:11:09 +03:00 committed by Alexey Vanin
parent 298662df9d
commit 01323ca8e0
3 changed files with 77 additions and 2 deletions

View file

@ -219,6 +219,9 @@ func (h *handler) readTagSet(reader io.Reader) (map[string]string, error) {
tagSet := make(map[string]string, len(tagging.TagSet))
for _, tag := range tagging.TagSet {
if _, ok := tagSet[tag.Key]; ok {
return nil, errors.GetAPIError(errors.ErrInvalidTagKeyUniqueness)
}
tagSet[tag.Key] = tag.Value
}