-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Rename "affinity-assistant" to "coschedule-assistant" in user-visible surfaces #9705
Copy link
Copy link
Open
Open
Copy link
Labels
kind/featureCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.
Description
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-assistantprefix - Cleanup code looks for both old and new StatefulSet names (handles in-flight PipelineRuns during upgrade)
- ConfigMap accepts both
default-affinity-assistant-pod-templateanddefault-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/annotationspkg/reconciler/pipelinerun/affinity_assistant.go— StatefulSet creation, naming, cleanuppkg/apis/config/default.go— ConfigMap key for default pod templatepkg/reconciler/pipelinerun/pipelinerun.go— annotation on TaskRun podspkg/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 sayaffinity-assistant - Clarity: "coschedule-assistant" better describes what the pod does (co-schedules tasks to the same node)
- The old
disable-affinity-assistantflag has already been removed and migrated tocoschedule
/kind feature
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
kind/featureCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.
Type
Projects
Status
Todo