Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
devigned committed Oct 28, 2021
1 parent 767eb73 commit 429ec98
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions exp/controllers/azuremanagedmachinepool_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ func (ammpr *AzureManagedMachinePoolReconciler) reconcileNormal(ctx context.Cont

if err := ammpr.createAzureManagedMachinePoolService(scope).Reconcile(ctx); err != nil {
if IsAgentPoolVMSSNotFoundError(err) {
log.V(2).Info(fmt.Sprintf("unable to find agent pool %s/%s", scope.InfraMachinePool.Namespace, scope.InfraMachinePool.Name))
// if the underlying VMSS is not yet created, requeue for 30s in the future
return reconcile.Result{
RequeueAfter: 30 * time.Second,
Expand Down
5 changes: 5 additions & 0 deletions exp/controllers/azuremanagedmachinepool_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,21 @@ func (s *azureManagedMachinePoolService) Reconcile(ctx context.Context) error {
return errors.Wrapf(err, "failed to list vmss in resource group %s", nodeResourceGroup)
}

log := s.scope.WithValues("agentPoolName", agentPoolName).V(2)

var match *compute.VirtualMachineScaleSet
for _, ss := range vmss {
ss := ss
log.Info("found vmss", "vmssName", ss.Name, "tags", ss.Tags)
if ss.Tags["poolName"] != nil && *ss.Tags["poolName"] == agentPoolName {
match = &ss
log.Info("found match")
break
}
}

if match == nil {
log.Info("no match found")
return NewAgentPoolVMSSNotFoundError(nodeResourceGroup, agentPoolName)
}

Expand Down

0 comments on commit 429ec98

Please sign in to comment.