Skip to content

Commit

Permalink
Merge pull request #3018 from vincepri/forward-port3010
Browse files Browse the repository at this point in the history
🐛Exclude conversion-data annotation when MD reconciles
  • Loading branch information
k8s-ci-robot authored May 6, 2020
2 parents a799265 + 6106e39 commit 43ddd32
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions controllers/mdutil/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ import (

"github.com/davecgh/go-spew/spew"
"github.com/go-logr/logr"
v1 "k8s.io/api/core/v1"
corev1 "k8s.io/api/core/v1"
apiequality "k8s.io/apimachinery/pkg/api/equality"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
intstrutil "k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/utils/integer"
clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3"
"sigs.k8s.io/cluster-api/util/conversion"
)

const (
Expand Down Expand Up @@ -139,11 +140,18 @@ func Revision(obj runtime.Object) (int64, error) {
}

var annotationsToSkip = map[string]bool{
v1.LastAppliedConfigAnnotation: true,
corev1.LastAppliedConfigAnnotation: true,
clusterv1.RevisionAnnotation: true,
clusterv1.RevisionHistoryAnnotation: true,
clusterv1.DesiredReplicasAnnotation: true,
clusterv1.MaxReplicasAnnotation: true,

// Exclude the conversion annotation, to avoid infinite loops between the conversion webhook
// and the MachineDeployment controller syncing the annotations between a MachineDeployment
// and its linked MachineSets.
//
// See https://github.com/kubernetes-sigs/cluster-api/pull/3010#issue-413767831 for more details.
conversion.DataAnnotation: true,
}

// skipCopyAnnotation returns true if we should skip copying the annotation with the given annotation key
Expand Down

0 comments on commit 43ddd32

Please sign in to comment.