You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pkg/tags: Remove doesn't decrement the tag count, so Add hits the limit too early #967
Tags.Remove deletes the tag from the list but doesn't decrement the internal counter numtags. addTags checks that counter against the maximum number of tags (100), so after removing tags, Add on the same Tags object can refuse new tags although there is room.
Reproduce (against current main):
ts:=tags.New(hundredTags...) // 100 tagsts.Remove("t0") // true, 99 tags leftts.Add("new") // false: the counter is still at 100
Impact: low. The callers in opencloud create a new Tags object for each request and either add or remove tags, so they don't run into this today.
Fix: decrement numtags in Remove, plus a unit test.
Note that this is not a bug that affects us as of now, but it's to prevent it from affecting us in the future if that code is used differently and/or somewhere else.
Activity
pbleser-oc commentedon Nov 4, 2026
Note that this is not a bug that affects us as of now, but it's to prevent it from affecting us in the future if that code is used differently and/or somewhere else.
fix(tags): free a slot for each removed tag