Change:
The Deployment overlap annotation () is no longer populated nor used by 1.6+ on the server side. However, in we maintained knowledge of the annotation for 1.6 clients in case they talk to pre-1.6 servers. That PR also adds code to clean up the annotation whenever it's found in 1.6+ clusters, so that pre-1.6 clients don't see it and make the wrong assumptions. The code handling this annotation should be removed when all the following conditions are met: We no longer support a 1.5.x client talking to the latest server version. We no longer support upgrading the server directly from 1.5.x to the latest version. The soonest milestone that meets both conditions according to the is v1.8. This issue should be moved to that milestone once it exists.
TODOs: [x] deployment controller: [x] deployment util: [x] deployment reaper: [x] deployment describer:
I can help on this
/assign
GitHub didn't allow me to assign the following users: wanghaoran1988. Note that only can be assigned. <detailsIn response to : /assign Instructions for interacting with me using PR comments are available . If you have questions or suggestions related to my behavior, please file an issue against the repository. </details
thanks, feel free to send patches

Discussion:
return nil } <del> // This is the point at which we used to add/remove the overlap annotation. // Now we always remove it if it exists, because it is obsolete as of 1.6. // Although the server no longer adds or looks at the annotation, // it's important to remove it from controllers created before the upgrade, // so that old clients (e.g. kubectl reaper) know they can no longer assume // the controller is blocked due to selector overlap and has no dependents. if _, ok := d.Annotations[util.OverlapAnnotation]; ok { delete(d.Annotations, util.OverlapAnnotation) d, err = dc.client.ExtensionsV1beta1().Deployments(d.Namespace).UpdateStatus(d) if err != nil { return fmt.Errorf("couldn't remove obsolete overlap annotation from deployment %v: %v", key, err) } } </del> // List ReplicaSets owned by this Deployment, while reconciling ControllerRef // through adoption/orphaning. rsList, err := dc.getReplicaSetsForDeployment(d)

f.run(getKey(d, t)) } <del> func TestSyncDeploymentClearsOverlapAnnotation(t *testing.T) { f := newFixture(t) d := newDeployment("foo", 1, nil, nil, nil, map[string]string{"foo": "bar"}) d.Annotations[util.OverlapAnnotation] = "overlap" f.dLister = append(f.dLister, d) f.objects = append(f.objects, d) rs := newReplicaSet(d, "deploymentrs-4186632231", 1) f.expectUpdateDeploymentStatusAction(d) f.expectCreateRSAction(rs) f.expectUpdateDeploymentStatusAction(d) f.expectUpdateDeploymentStatusAction(d) f.run(getKey(d, t)) d, err := f.client.ExtensionsV1beta1().Deployments(d.Namespace).Get(d.Name, metav1.GetOptions{}) if err != nil { t.Fatalf("can't get deployment: %v", err) } if _, ok := d.Annotations[util.OverlapAnnotation]; ok { t.Errorf("OverlapAnnotation = %q, wanted absent", d.Annotations[util.OverlapAnnotation]) } } </del> func TestSyncDeploymentDontDoAnythingDuringDeletion(t *testing.T) { f := newFixture(t)

RollbackTemplateUnchanged = "DeploymentRollbackTemplateUnchanged" // RollbackDone is the done rollback event reason RollbackDone = "DeploymentRollback" <del> // OverlapAnnotation marks deployments with overlapping selector with other deployments // TODO: Delete this annotation when we no longer need to support a client //       talking to a server older than v1.6. OverlapAnnotation = "deployment.kubernetes.io/error-selector-overlapping-with" </del> // Reasons for deployment conditions // // Progressing:

RevisionHistoryAnnotation:      true, DesiredReplicasAnnotation:      true, MaxReplicasAnnotation:          true, <del> OverlapAnnotation:              true, </del> } // skipCopyAnnotation returns true if we should skip copying the annotation with the given annotation key

return err } <del> // Do not cascade deletion for overlapping deployments. // A Deployment with this annotation will not create or manage anything, // so we can assume any matching ReplicaSets belong to another Deployment. if len(deployment.Annotations[deploymentutil.OverlapAnnotation]) > 0 { return deployments.Delete(name, nil) } </del> // Stop all replica sets belonging to this Deployment. rss, err := deploymentutil.ListReplicaSetsInternal(deployment, func(namespace string, options metav1.ListOptions) ([]*extensions.ReplicaSet, error) {

} w.Write(LEVEL_0, "NewReplicaSet:t%sn", printReplicaSetsByLabels(newRSs)) } <del> overlapWith := d.Annotations[deploymentutil.OverlapAnnotation] if len(overlapWith) > 0 { w.Write(LEVEL_0, "!!!WARNING!!! This deployment has overlapping label selector with deployment %q and won't behave as expected. Please fix it before continuing.n", overlapWith) } </del> if events != nil { DescribeEvents(events, w) }