Skip to content

pkg/tags: Remove doesn't decrement the tag count, so Add hits the limit too early #967

Closed

Description

@pbleser-oc

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 tags
ts.Remove("t0")                // true, 99 tags left
ts.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.

Activity

  1. added theissue type on Nov 3, 2026
  2. moved this from Qualification to Prio <= 3 in OpenCloud Team Boardon Nov 3, 2026
  3. pbleser-oc commented on Nov 4, 2026

    @pbleser-oc
    MemberAuthor

    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.

  4. added a commit that references this issue on Nov 5, 2026
    f46f769
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions