Skip to content

Commit 66bd450

Browse files
committed
Skip tag reconciliation in Azure Stack
The tag service using the V2 SDK is not available in azure stack. Skip tag reconciliation in Azure Stack environments.
1 parent 435df16 commit 66bd450

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

controllers/azuremachine_reconciler.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package controllers
1818

1919
import (
2020
"context"
21+
"strings"
2122

2223
"github.com/pkg/errors"
2324

@@ -101,10 +102,19 @@ func newAzureMachineService(machineScope *scope.MachineScope) (*azureMachineServ
101102
virtualmachinesSvc,
102103
roleAssignmentsSvc,
103104
vmextensionsSvc,
104-
tagsSvc,
105105
},
106106
skuCache: cache,
107107
}
108+
109+
// The tags service fails in Azure Stack because the current SDK implementation
110+
// will throw an error when trying to get tags at scope on Azure Stack environments.
111+
// This means tags can only be provided on Azure Stack machines at creation time
112+
// and will not be reconciled day-2. Once the get-tags-at-scope SDK issue is
113+
// addressed, this change can be reverted to add tagsSvc in all environments.
114+
if !strings.EqualFold(machineScope.CloudEnvironment(), azure.StackCloudName) {
115+
ams.services = append(ams.services, tagsSvc)
116+
}
117+
108118
ams.Reconcile = ams.reconcile
109119
ams.Pause = ams.pause
110120
ams.Delete = ams.delete

0 commit comments

Comments
 (0)