Skip to content

Commit b7108c2

Browse files
committed
fix
1 parent 8988b16 commit b7108c2

File tree

1 file changed

+1
-49
lines changed

1 file changed

+1
-49
lines changed

test/utils/azure/azure_helper.go

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -124,53 +124,5 @@ func (az *Client) GetAccountNumByResourceGroup(ctx context.Context, groupName st
124124
if err != nil {
125125
return -1, err
126126
}
127-
return len(result.Values()), nil
128-
}
129-
130-
func getCloudConfig(env azure.Environment) cloud.Configuration {
131-
switch env.Name {
132-
case azure.USGovernmentCloud.Name:
133-
return cloud.AzureGovernment
134-
case azure.ChinaCloud.Name:
135-
return cloud.AzureChina
136-
case azure.PublicCloud.Name:
137-
return cloud.AzurePublic
138-
default:
139-
return cloud.Configuration{
140-
ActiveDirectoryAuthorityHost: env.ActiveDirectoryEndpoint,
141-
Services: map[cloud.ServiceName]cloud.ServiceConfiguration{
142-
cloud.ResourceManager: {
143-
Audience: env.TokenAudience,
144-
Endpoint: env.ResourceManagerEndpoint,
145-
},
146-
},
147-
}
148-
}
149-
}
150-
151-
func getClient(env azure.Environment, subscriptionID, _ string, cred *azidentity.ClientSecretCredential, scope string) *Client {
152-
c := &Client{
153-
environment: env,
154-
subscriptionID: subscriptionID,
155-
groupsClient: resources.NewGroupsClientWithBaseURI(env.ResourceManagerEndpoint, subscriptionID),
156-
accountsClient: storage.NewAccountsClient(subscriptionID),
157-
}
158-
159-
if !strings.HasSuffix(scope, "/.default") {
160-
scope += "/.default"
161-
}
162-
// Use an adapter so azidentity in the Azure SDK can be used as Authorizer
163-
// when calling the Azure Management Packages, which we currently use. Once
164-
// the Azure SDK clients (found in /sdk) move to stable, we can update our
165-
// clients and they will be able to use the creds directly without the
166-
// authorizer.
167-
authorizer := azidext.NewTokenCredentialAdapter(cred, []string{scope})
168-
c.groupsClient.Authorizer = authorizer
169-
c.accountsClient.Authorizer = authorizer
170-
171-
return c
172-
}
173-
174-
func stringPointer(s string) *string {
175-
return &s
127+
return len(result), nil
176128
}

0 commit comments

Comments
 (0)