File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
azure/services/agentpools Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -237,6 +237,14 @@ func (s *AgentPoolSpec) Parameters(ctx context.Context, existing interface{}) (p
237237 normalizedProfile .Count = existingProfile .Count
238238 }
239239
240+ // We do a just-in-time merge of existent kubernetes.azure.com-prefixed labels
241+ // So that we don't unintentionally delete them
242+ // See https://github.com/Azure/AKS/issues/3152
243+ if normalizedProfile .NodeLabels != nil {
244+ nodeLabels = mergeSystemNodeLabels (normalizedProfile .NodeLabels , existingPool .NodeLabels )
245+ normalizedProfile .NodeLabels = nodeLabels
246+ }
247+
240248 // Compute a diff to check if we require an update
241249 diff := cmp .Diff (normalizedProfile , existingProfile )
242250 if diff == "" {
@@ -245,12 +253,6 @@ func (s *AgentPoolSpec) Parameters(ctx context.Context, existing interface{}) (p
245253 return nil , nil
246254 }
247255 log .V (4 ).Info ("found a diff between the desired spec and the existing agentpool" , "difference" , diff )
248- // We do a just-in-time merge of existent kubernetes.azure.com-prefixed labels
249- // So that we don't unintentionally delete them
250- // See https://github.com/Azure/AKS/issues/3152
251- if normalizedProfile .NodeLabels != nil {
252- nodeLabels = mergeSystemNodeLabels (normalizedProfile .NodeLabels , existingPool .NodeLabels )
253- }
254256 }
255257
256258 var availabilityZones * []string
You can’t perform that action at this time.
0 commit comments