mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-11-02 06:47:34 +00:00
Deployment: Remove Overlap and SelectorUpdate annotations.
These are not used anymore since ControllerRef now protects against fighting between controllers with overlapping selectors.
This commit is contained in:
@@ -19,9 +19,7 @@ package deployment
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
"time"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/fields"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
@@ -34,7 +32,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/apis/extensions"
|
||||
"k8s.io/kubernetes/pkg/apis/extensions/validation"
|
||||
"k8s.io/kubernetes/pkg/controller/deployment/util"
|
||||
)
|
||||
|
||||
// deploymentStrategy implements behavior for Deployments.
|
||||
@@ -93,15 +90,6 @@ func (deploymentStrategy) PrepareForUpdate(ctx genericapirequest.Context, obj, o
|
||||
!reflect.DeepEqual(newDeployment.Annotations, oldDeployment.Annotations) {
|
||||
newDeployment.Generation = oldDeployment.Generation + 1
|
||||
}
|
||||
|
||||
// Records timestamp on selector updates in annotation
|
||||
if !reflect.DeepEqual(newDeployment.Spec.Selector, oldDeployment.Spec.Selector) {
|
||||
if newDeployment.Annotations == nil {
|
||||
newDeployment.Annotations = make(map[string]string)
|
||||
}
|
||||
now := metav1.Now()
|
||||
newDeployment.Annotations[util.SelectorUpdateAnnotation] = now.Format(time.RFC3339)
|
||||
}
|
||||
}
|
||||
|
||||
// ValidateUpdate is the default update validation for an end user.
|
||||
|
||||
Reference in New Issue
Block a user