Skip to content

Commit 2263f41

Browse files
authored
Merge pull request kubernetes-sigs#3010 from vincepri/bug-alpha2-annotatione
🐛 [0.2] Exclude conversion-data annotation when MD reconciles
2 parents 1bf0efd + 688528e commit 2263f41

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

controllers/mdutil/util.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import (
3434
"k8s.io/klog"
3535
"k8s.io/utils/integer"
3636
clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha2"
37+
"sigs.k8s.io/cluster-api/util/conversion"
3738
)
3839

3940
const (
@@ -156,6 +157,13 @@ var annotationsToSkip = map[string]bool{
156157
RevisionHistoryAnnotation: true,
157158
DesiredReplicasAnnotation: true,
158159
MaxReplicasAnnotation: true,
160+
161+
// Exclude the conversion annotation, to avoid infinite loops between the conversion webhook
162+
// and the MachineDeployment controller syncing the annotations between a MachineDeployment
163+
// and its linked MachineSets.
164+
//
165+
// See https://github.com/kubernetes-sigs/cluster-api/pull/3010#issue-413767831 for more details.
166+
conversion.DataAnnotation: true,
159167
}
160168

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

util/conversion/conversion.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
Copyright 2019 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package conversion
18+
19+
const (
20+
DataAnnotation = "cluster.x-k8s.io/conversion-data"
21+
)

0 commit comments

Comments
 (0)