File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ package controllers
18
18
19
19
import (
20
20
"context"
21
+ "strings"
21
22
22
23
"github.com/pkg/errors"
23
24
@@ -101,10 +102,19 @@ func newAzureMachineService(machineScope *scope.MachineScope) (*azureMachineServ
101
102
virtualmachinesSvc ,
102
103
roleAssignmentsSvc ,
103
104
vmextensionsSvc ,
104
- tagsSvc ,
105
105
},
106
106
skuCache : cache ,
107
107
}
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
+
108
118
ams .Reconcile = ams .reconcile
109
119
ams .Pause = ams .pause
110
120
ams .Delete = ams .delete
You can’t perform that action at this time.
0 commit comments