-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cleanup: [TEP-0135] remove deprecated disable-affinity-assistant feature flag #8603
base: main
Are you sure you want to change the base?
cleanup: [TEP-0135] remove deprecated disable-affinity-assistant feature flag #8603
Conversation
/cc @vdemeester |
configMap := &corev1.ConfigMap{ | ||
ObjectMeta: metav1.ObjectMeta{Name: config.GetFeatureFlagsConfigName(), Namespace: system.Namespace()}, | ||
Data: map[string]string{ | ||
featureFlagDisableAffinityAssistantKey: "true", | ||
"coschedule": "disabled", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned in the action required, if you want to maintain the execution behavior, you may need to set the coschedule
to disabled.
The focus is on the line of code below: (line: 53)
pipeline/pkg/internal/affinityassistant/affinityassistant_types.go
Lines 34 to 55 in aec465e
// GetAffinityAssistantBehavior returns an AffinityAssistantBehavior based on the | |
// combination of "disable-affinity-assistant" and "coschedule" feature flags | |
// TODO(#6740)(WIP): consume this function in the PipelineRun reconciler to determine Affinity Assistant behavior. | |
func GetAffinityAssistantBehavior(ctx context.Context) (AffinityAssistantBehavior, error) { | |
cfg := config.FromContextOrDefaults(ctx) | |
disableAA := cfg.FeatureFlags.DisableAffinityAssistant | |
coschedule := cfg.FeatureFlags.Coschedule | |
// at this point, we have validated that "coschedule" can only be "workspaces" | |
// when "disable-affinity-assistant" is false | |
if !disableAA { | |
return AffinityAssistantPerWorkspace, nil | |
} | |
switch coschedule { | |
case config.CoschedulePipelineRuns: | |
return AffinityAssistantPerPipelineRun, nil | |
case config.CoscheduleIsolatePipelineRun: | |
return AffinityAssistantPerPipelineRunWithIsolation, nil | |
case config.CoscheduleDisabled, config.CoscheduleWorkspaces: | |
return AffinityAssistantDisabled, nil | |
} |
The following is the coverage report on the affected files.
|
"test-pipeline-run-variable-substitution", "test-pipeline", "b-task", false), | ||
taskRunObjectMetaWithAnnotations("test-pipeline-run-variable-substitution-b-task", "foo", | ||
"test-pipeline-run-variable-substitution", "test-pipeline", "b-task", false, map[string]string{ | ||
"pipeline.tekton.dev/affinity-assistant": "affinity-assistant-0358aabfa2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the previous setting of disable-affinity-assistant
was true, the default behavior was not to add the relevant annotations. Now that the feature switch has been removed, the behavior has changed somewhat.
Theoretically, the previous effect can also be achieved by setting other feature switches.
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
/assign |
# or https://github.com/tektoncd/pipeline/pull/2630 for more info. | ||
# | ||
# Note: This feature flag is deprecated and will be removed in release v0.60. Consider using `coschedule` feature flag to configure Affinity Assistant behavior. | ||
disable-affinity-assistant: "false" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
**Note:** Pod anti-affinity requires nodes to be consistently labelled, in other words every | ||
node in the cluster must have an appropriate label matching `topologyKey`. If some or all nodes | ||
are missing the specified `topologyKey` label, it can lead to unintended behavior. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
Currently, the Affinity Assistant Modes can be configured by the `disable-affinity-assistant` and `coschedule` feature flags. | ||
The `disable-affinity-assistant` feature flag is now deprecated and will be removed in release `v0.60`. At the time, the Affinity Assistant Modes will be only determined by the `coschedule` feature flag. | ||
The Affinity Assistant Modes are configured by the `coschedule` feature flag. | ||
Previously, it was also controlled by the `disable-affinity-assistant` feature flag which was deprecated and removed after release `v0.68`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I believe this needs to go in a note as it's not directly useful while configuring the affinity assistant for user at the time of reading the docs for affinity assistant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it okay to write like this in the notes?
Action Required: The feature flag `disable-affinity-assistant` has been removed. Please use `coschedule` as a replacement.
It was marked as deprecated in version v0.51 and has been completely removed in the current version.
If you need to maintain the previous default behavior, set feature flag `coschedule` to `disabled`.
For specific behavioral differences, please refer to: https://github.com/tektoncd/community/blob/main/teps/0135-coscheduling-pipelinerun-pods.md#tep-0135-coscheduling-pipelinerun-pods
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that'll work 😸
/approve |
Looks like this also fixes the bug that coschedule was actually disabled when set to 'workspaces' Or is this is expected behavior and AA has to be enabled for now until flag is removed? We are ruuning v0.65.6 and coscheduling seems to not work with |
In v0.65.6, the |
e365ea3
to
ec80a75
Compare
The following is the coverage report on the affected files.
|
ec80a75
to
25d7a0c
Compare
The following is the coverage report on the affected files.
|
config/300-crds/300-pipelinerun.yaml
Outdated
disableCredsInit: | ||
description: DisableAffinityAssistant bool `json:"disableAffinityAssistant,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those descriptions seems weird, don't they ?
pkg/apis/config/feature_flags.go
Outdated
@@ -188,7 +185,7 @@ var ( | |||
// FeatureFlags holds the features configurations | |||
// +k8s:deepcopy-gen=true | |||
type FeatureFlags struct { | |||
DisableAffinityAssistant bool `json:"disableAffinityAssistant,omitempty"` | |||
// DisableAffinityAssistant bool `json:"disableAffinityAssistant,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either we keep it as no-op (in order to not fail existing configuration), or we remove it, but we shouldn't keep the comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that the strange annotations generated by hack/update-codegen.sh
are due to the comments below. I removed the comments and regenerated it, and it worked fine.
Please have a look when you have time. Thank you!
25d7a0c
to
b39da59
Compare
The following is the coverage report on the affected files.
|
…ure flag This field has been deprecated for about a year and half. So this is "removing" this feature flag from the codebase. The field is kept in the go code to provide a backward compatibility for client code (like chains, …) but it will be disallowed by the webhook. It will also be completely ignore by the rest of the code.
b39da59
to
2c9f859
Compare
The following is the coverage report on the affected files.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vdemeester, waveywaves The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
fix #8587
This field has been deprecated for about a year and half. So this is "removing" this feature flag from the codebase.
The field is kept in the go code to provide a backward compatibility for client code (like chains, …) but it will be disallowed by the webhook. It will also be completely ignore by the rest of the code.
Changes
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
/kind <type>
. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes
/kind cleanup