Skip to content

Commit

Permalink
init sub repo in storage account package
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinForReal committed Dec 13, 2024
1 parent ae8bf54 commit fe3d720
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pkg/provider/storage/azure_storageaccount.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6"
privatedns "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/google/uuid"
"k8s.io/klog/v2"
"k8s.io/utils/ptr"
Expand Down Expand Up @@ -102,7 +101,7 @@ type accountWithLocation struct {
}
type AccountRepo struct {
azureconfig.Config
Environment azure.Environment
Environment *azclient.Environment
ComputeClientFactory azclient.ClientFactory
NetworkClientFactory azclient.ClientFactory
subnetRepo subnet.Repository
Expand All @@ -111,7 +110,7 @@ type AccountRepo struct {
lockMap *lockmap.LockMap
}

func NewRepository(config azureconfig.Config, env azure.Environment, computeClientFactory azclient.ClientFactory, networkClientFactory azclient.ClientFactory) (*AccountRepo, error) {
func NewRepository(config azureconfig.Config, env *azclient.Environment, computeClientFactory azclient.ClientFactory, networkClientFactory azclient.ClientFactory) (*AccountRepo, error) {
getter := func(_ context.Context, _ string) (*armstorage.Account, error) { return nil, nil }
storageAccountCache, err := cache.NewTimedCache(time.Minute, getter, config.DisableAPICallCache)
if err != nil {
Expand All @@ -121,12 +120,17 @@ func NewRepository(config azureconfig.Config, env azure.Environment, computeClie
if err != nil {
return nil, err
}
subnetRepo, err := subnet.NewRepo(networkClientFactory.GetSubnetClient())
if err != nil {
return nil, err
}
return &AccountRepo{
Config: config,
Environment: env,
fileServiceRepo: fileserviceRepo,
ComputeClientFactory: computeClientFactory,
NetworkClientFactory: networkClientFactory,
subnetRepo: subnetRepo,
storageAccountCache: storageAccountCache,
lockMap: lockmap.NewLockMap(),
}, nil
Expand Down

0 comments on commit fe3d720

Please sign in to comment.