mirror of
https://github.com/kubernetes-sigs/external-dns.git
synced 2025-08-06 01:26:59 +02:00
use json to unmarshal json
Signed-off-by: Raffaele Di Fazio <difazio.raffaele@gmail.com>
This commit is contained in:
parent
b38d6bc867
commit
3e9f4642e3
@ -17,6 +17,7 @@ limitations under the License.
|
||||
package azure
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
@ -25,7 +26,6 @@ import (
|
||||
"github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
|
||||
"github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud"
|
||||
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
|
||||
yaml "github.com/goccy/go-yaml"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
@ -50,9 +50,8 @@ func getConfig(configFile, subscriptionID, resourceGroup, userAssignedIdentityCl
|
||||
return nil, fmt.Errorf("failed to read Azure config file '%s': %v", configFile, err)
|
||||
}
|
||||
cfg := &config{}
|
||||
err = yaml.Unmarshal(contents, &cfg)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to read Azure config file '%s': %v", configFile, err)
|
||||
if err := json.Unmarshal(contents, &cfg); err != nil {
|
||||
return nil, fmt.Errorf("failed to parse Azure config file '%s': %v", configFile, err)
|
||||
}
|
||||
// If a subscription ID was given, override what was present in the config file
|
||||
if subscriptionID != "" {
|
||||
|
Loading…
Reference in New Issue
Block a user