Skip to content

Rename "affinity-assistant" to "coschedule-assistant" in user-visible surfaces #9705

@vdemeester

Description

@vdemeester

Summary

The disable-affinity-assistant feature flag was renamed to coschedule (see #7307), but the underlying pods, StatefulSets, labels, annotations, and ConfigMap keys still use the old "affinity-assistant" naming. This is confusing — users see coschedule in the config but affinity-assistant in their cluster.

We should rename the user-visible surfaces from "affinity-assistant" to "coschedule-assistant" to align with the feature flag.

User-Visible Surfaces to Rename

# What Current Value Proposed Value
1 Container name affinity-assistant coschedule-assistant
2 StatefulSet name prefix affinity-assistant-<hash> coschedule-assistant-<hash>
3 Label app.kubernetes.io/component affinity-assistant coschedule-assistant
4 Label app.kubernetes.io/instance affinity-assistant-<hash> coschedule-assistant-<hash>
5 Annotation on TaskRun pods pipeline.tekton.dev/affinity-assistant pipeline.tekton.dev/coschedule-assistant
6 ConfigMap key default-affinity-assistant-pod-template default-coschedule-assistant-pod-template
7 Event reason ReasonCouldntCreateOrUpdateAffinityAssistantStatefulSet ReasonCouldntCreateOrUpdateCoscheduleAssistantStatefulSet

Proposed Phased Approach

Phase 1: Accept both names (non-breaking)

  • New StatefulSets/pods use coschedule-assistant prefix
  • Cleanup code looks for both old and new StatefulSet names (handles in-flight PipelineRuns during upgrade)
  • ConfigMap accepts both default-affinity-assistant-pod-template and default-coschedule-assistant-pod-template
  • Write both annotations on TaskRun pods, read either
  • Label selectors match on either component name

Phase 2: Deprecation warnings (1-2 releases later)

  • Log deprecation warnings when old ConfigMap key / annotation is detected
  • Documentation updated to reference new names only

Phase 3: Remove old names (2-3 releases after Phase 1)

  • Drop old constants and dual-read/write logic
  • Only accept new names

Key Files Affected

  • pkg/workspace/affinity_assistant_names.go — constants for labels/annotations
  • pkg/reconciler/pipelinerun/affinity_assistant.go — StatefulSet creation, naming, cleanup
  • pkg/apis/config/default.go — ConfigMap key for default pod template
  • pkg/reconciler/pipelinerun/pipelinerun.go — annotation on TaskRun pods
  • pkg/reconciler/taskrun/taskrun.go — reads annotation

Internal Go types and file names (e.g., AffinityAssistantTemplate, affinity_assistant.go) can be renamed separately in a follow-up to keep this focused on user-visible changes.

Why

  • Consistency: the feature flag is coschedule, but the artifacts in the cluster say affinity-assistant
  • Clarity: "coschedule-assistant" better describes what the pod does (co-schedules tasks to the same node)
  • The old disable-affinity-assistant flag has already been removed and migrated to coschedule

/kind feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions