Skip to content

Commit 170b6f9

Browse files
committed
Azure Stack: assume all IPs are managed
Trying to get tags at scope in Azure Stack results in an error, so just assume that IPs are managed.
1 parent 32e327a commit 170b6f9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

azure/services/publicips/publicips.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package publicips
1818

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

2223
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4"
2324
"github.com/pkg/errors"
@@ -151,6 +152,12 @@ func (s *Service) Delete(ctx context.Context) error {
151152
// isIPManaged returns true if the IP has an owned tag with the cluster name as value,
152153
// meaning that the IP's lifecycle is managed.
153154
func (s *Service) isIPManaged(ctx context.Context, spec azure.ResourceSpecGetter) (bool, error) {
155+
if strings.EqualFold(s.Scope.CloudEnvironment(), azure.StackCloudName) {
156+
// Azure Stack does not yet support getting tags with scope,
157+
// so assume IPs are managed.
158+
return true, nil
159+
}
160+
154161
scope := azure.PublicIPID(s.Scope.SubscriptionID(), spec.ResourceGroupName(), spec.ResourceName())
155162
result, err := s.TagsGetter.GetAtScope(ctx, scope)
156163
if err != nil {

0 commit comments

Comments
 (0)