Skip to content

Commit f6535af

Browse files
author
Cecile Robert-Michon
committed
Fix AzureMachinePoolMachine controller test MSI error when run locally
1 parent 2679730 commit f6535af

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

exp/controllers/azuremachinepoolmachine_controller_test.go

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

1919
import (
2020
"context"
21+
"os"
2122
"testing"
2223
"time"
2324

25+
"github.com/Azure/go-autorest/autorest/azure/auth"
26+
2427
"github.com/golang/mock/gomock"
2528
. "github.com/onsi/gomega"
2629
corev1 "k8s.io/api/core/v1"
@@ -73,6 +76,10 @@ func TestAzureMachinePoolMachineReconciler_Reconcile(t *testing.T) {
7376
},
7477
}
7578

79+
os.Setenv(auth.ClientID, "fooClient")
80+
os.Setenv(auth.ClientSecret, "fooSecret")
81+
os.Setenv(auth.TenantID, "fooTenant")
82+
7683
for _, c := range cases {
7784
t.Run(c.Name, func(t *testing.T) {
7885
var (

0 commit comments

Comments
 (0)