Skip to content

Commit 3e9f464

Browse files
committed
use json to unmarshal json
Signed-off-by: Raffaele Di Fazio <[email protected]>
1 parent b38d6bc commit 3e9f464

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

provider/azure/config.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
package azure
1818

1919
import (
20+
"encoding/json"
2021
"fmt"
2122
"os"
2223
"strings"
@@ -25,7 +26,6 @@ import (
2526
"github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
2627
"github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud"
2728
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
28-
yaml "github.com/goccy/go-yaml"
2929
log "github.com/sirupsen/logrus"
3030
)
3131

@@ -50,9 +50,8 @@ func getConfig(configFile, subscriptionID, resourceGroup, userAssignedIdentityCl
5050
return nil, fmt.Errorf("failed to read Azure config file '%s': %v", configFile, err)
5151
}
5252
cfg := &config{}
53-
err = yaml.Unmarshal(contents, &cfg)
54-
if err != nil {
55-
return nil, fmt.Errorf("failed to read Azure config file '%s': %v", configFile, err)
53+
if err := json.Unmarshal(contents, &cfg); err != nil {
54+
return nil, fmt.Errorf("failed to parse Azure config file '%s': %v", configFile, err)
5655
}
5756
// If a subscription ID was given, override what was present in the config file
5857
if subscriptionID != "" {

0 commit comments

Comments
 (0)