Skip to content

Commit 6401096

Browse files
adrianrioboanjannath
authored andcommitted
fix: Default location for Azure
This commit removes the error in case it is not set, as it may is set or not, on Azure is not mandatory, also in case not set mapt will print anf Info message telling how to set it. Otherwise the change introduced 17f871c would break backwards compatibility. Signed-off-by: Adrian Riobo <[email protected]>
1 parent 959c4d6 commit 6401096

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

pkg/manager/context/context.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ func Init(ca *ContextArgs, provider Provider) (*Context, error) {
8989
if err != nil {
9090
return nil, err
9191
}
92-
c.targetHostingPlace = *hp
92+
if hp != nil {
93+
c.targetHostingPlace = *hp
94+
}
9395
// Manage
9496
if err := provider.Init(ca.BackedURL); err != nil {
9597
return nil, err

pkg/provider/azure/azure.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package azure
22

33
import (
4-
"fmt"
54
"os"
65
"slices"
76
"strings"
@@ -39,7 +38,8 @@ func (a *Azure) DefaultHostingPlace() (*string, error) {
3938
if len(hp) > 0 {
4039
return &hp, nil
4140
}
42-
return nil, fmt.Errorf("missing default value for Azure Location")
41+
logging.Infof("missing default value for Azure Location, if needed it should set using ARM_LOCATION_NAME or AZURE_DEFAULTS_LOCATION")
42+
return nil, nil
4343
}
4444

4545
// Envs required for auth with go sdk

0 commit comments

Comments
 (0)