Skip to content

Commit

Permalink
debug reconciler steps
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeldeib committed Jul 2, 2021
1 parent 69cac90 commit 03ba941
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion exp/controllers/azuremanagedmachinepool_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,18 @@ func (s *azureManagedMachinePoolService) Reconcile(ctx context.Context, scope *s
agentPoolSpec.OSDiskSizeGB = *scope.InfraMachinePool.Spec.OSDiskSizeGB
}

scope.V(2).Info("Reconciling agentpool")
if err := s.agentPoolsSvc.Reconcile(ctx, agentPoolSpec); err != nil {
return errors.Wrapf(err, "failed to reconcile machine pool %s", scope.InfraMachinePool.Name)
}

scope.V(2).Info("Listing scalesets")
vmss, err := s.scaleSetsSvc.List(ctx, scope.ControlPlane.Spec.NodeResourceGroupName)
if err != nil {
return errors.Wrapf(err, "failed to list vmss in resource group %s", scope.ControlPlane.Spec.NodeResourceGroupName)
}

scope.V(2).Info("Matching scalesets to infra pools")
var match *compute.VirtualMachineScaleSet
for _, ss := range vmss {
ss := ss
Expand All @@ -141,10 +144,13 @@ func (s *azureManagedMachinePoolService) Reconcile(ctx context.Context, scope *s
}
}

scope.V(2).Info("Checking for match")
if match == nil {
scope.V(2).Info("No match")
return NewAgentPoolVMSSNotFoundError(scope.ControlPlane.Spec.NodeResourceGroupName, scope.InfraMachinePool.Name)
}

scope.V(2).Info("Listing VM instances")
instances, err := s.scaleSetsSvc.ListInstances(ctx, scope.ControlPlane.Spec.NodeResourceGroupName, *match.Name)
if err != nil {
return errors.Wrapf(err, "failed to reconcile machine pool %s", scope.InfraMachinePool.Name)
Expand All @@ -159,7 +165,7 @@ func (s *azureManagedMachinePoolService) Reconcile(ctx context.Context, scope *s
scope.InfraMachinePool.Status.Replicas = int32(len(providerIDs))
scope.InfraMachinePool.Status.Ready = true

scope.Logger.Info("reconciled machine pool successfully")
scope.V(2).Info("reconciled machine pool successfully")
return nil
}

Expand Down

0 comments on commit 03ba941

Please sign in to comment.