Skip to content

fix: encode team names in Kubernetes labels #216

Closed

Description

@uniqueg

Problem

With the auth profile, POST /ga4gh/tes/v1/tasks answers 500 for a member of a team group whose name isn't a valid Kubernetes label value. Seen in a test install with LS Login, for a member of the team group BioHackCloud%20Admins (a direct subgroup of the environment group, so a team by the documented model; LS Login percent-encodes the space):

ConfigMap "task-352dd20b" is invalid: metadata.labels: Invalid value: "BioHackCloud%20Admins": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character

TESK API writes the team name as is into the label creator-group-name of the taskmaster job and its ConfigMap (from tags['GROUP_NAME'] or a team of the user), and into the label selector for listing (creator-group-name in (...)). Label values are limited to 63 characters from [A-Za-z0-9._-], starting and ending with an alphanumeric character; team names are any text without : (spaces, %, Unicode, long names). Listing tasks breaks for the same users, and characters such as ) or ! can change the selector.

The user ID already has this solved (#119: hash label plus annotation).

Proposal

Same approach as for the creator:

  • label creator-group-name: the team name if it is a valid label value (as now, so existing tasks keep working), otherwise a fixed-length hash of it;
  • annotation creator-group-name: the full team name; the team of a task is the annotation if the label matches it, otherwise the label (tasks created before the annotation);
  • the list selector uses the same label values; the list filter checks the team as getting a task does.

Regression tests with several awkward team names (spaces, %, Unicode, over 63 characters, selector characters) and an odd sub; docs in docs/access-control.md.

Activity

  1. self-assigned this
    on Nov 23, 2026
  2. added
    type: bug
    priority: high
    status: in progress
    workload: hours
    on Nov 23, 2026
  3. moved this from Backlog to In progress in ELIXIR On-Cloudon Nov 23, 2026
  4. moved this from In progress to In review in ELIXIR On-Cloudon Nov 23, 2026
  5. moved this from In review to Done in ELIXIR On-Cloudon Nov 23, 2026
  6. removed
    status: in progress
    on Nov 23, 2026
  7. added this to the v2.1.0 milestone on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

priority: hightype: bugworkload: hours

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions