Skip to content

Commit

Permalink
Fix azure client for multiple clouds
Browse files Browse the repository at this point in the history
  • Loading branch information
nwnt committed Oct 24, 2023
1 parent 885c6fb commit 863b430
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/monitor/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
"sync"
"time"

"github.com/Azure/azure-sdk-for-go/sdk/azcore"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -240,7 +242,10 @@ func (mon *monitor) newNSGMonitor(log *logrus.Entry, oc *api.OpenShiftCluster, s
mon.clusterm.EmitGauge(nsg.MetricFailedNSGMonitorCreation, int64(1), dims)
return &monitoring.NoOpMonitor{Wg: wg}
}
client, err := armnetwork.NewSubnetsClient(subscriptionID, token, nil)
options := arm.ClientOptions{
ClientOptions: azcore.ClientOptions{Cloud: mon.env.Environment().Cloud},
}
client, err := armnetwork.NewSubnetsClient(subscriptionID, token, &options)
if err != nil {
log.Error("Unable to create the subnet client for NSG monitoring", err)
mon.clusterm.EmitGauge(nsg.MetricFailedNSGMonitorCreation, int64(1), dims)
Expand Down

0 comments on commit 863b430

Please sign in to comment.