Skip to content

Commit 83cf7f6

Browse files
authored
Merge pull request #3128 from nojnhuh/log-pool-diff
log diffs for agentpools
2 parents 1d28b4b + 7df14cf commit 83cf7f6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

azure/services/agentpools/spec.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import (
2929
"sigs.k8s.io/cluster-api-provider-azure/azure"
3030
"sigs.k8s.io/cluster-api-provider-azure/azure/converters"
3131
azureutil "sigs.k8s.io/cluster-api-provider-azure/util/azure"
32+
"sigs.k8s.io/cluster-api-provider-azure/util/tele"
3233
)
3334

3435
// KubeletConfig defines the set of kubelet configurations for nodes in pools.
@@ -160,6 +161,9 @@ func (s *AgentPoolSpec) CustomHeaders() map[string]string {
160161

161162
// Parameters returns the parameters for the agent pool.
162163
func (s *AgentPoolSpec) Parameters(ctx context.Context, existing interface{}) (params interface{}, err error) {
164+
_, log, done := tele.StartSpanWithLogger(ctx, "agentpools.Service.Parameters")
165+
defer done()
166+
163167
nodeLabels := s.NodeLabels
164168
if existing != nil {
165169
existingPool, ok := existing.(containerservice.AgentPool)
@@ -234,8 +238,10 @@ func (s *AgentPoolSpec) Parameters(ctx context.Context, existing interface{}) (p
234238
diff := cmp.Diff(normalizedProfile, existingProfile)
235239
if diff == "" {
236240
// agent pool is up to date, nothing to do
241+
log.V(4).Info("no changes found between user-updated spec and existing spec")
237242
return nil, nil
238243
}
244+
log.V(4).Info("found a diff between the desired spec and the existing agentpool", "difference", diff)
239245
// We do a just-in-time merge of existent kubernetes.azure.com-prefixed labels
240246
// So that we don't unintentionally delete them
241247
// See https://github.com/Azure/AKS/issues/3152

0 commit comments

Comments
 (0)