From e542a62033d3a22fdc0d2ff98728bb384ff43a4a Mon Sep 17 00:00:00 2001 From: Ludovic Ortega Date: Fri, 17 Nov 2023 09:43:50 +0100 Subject: [PATCH] Update provider/scaleway/scaleway.go Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com> --- provider/scaleway/scaleway.go | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/provider/scaleway/scaleway.go b/provider/scaleway/scaleway.go index 7a944ce29..8b7fc8c74 100644 --- a/provider/scaleway/scaleway.go +++ b/provider/scaleway/scaleway.go @@ -66,18 +66,16 @@ func NewScalewayProvider(ctx context.Context, domainFilter endpoint.DomainFilter } } - p := &scw.Profile{} - c, err := scw.LoadConfig() - if err != nil { - log.Infof("%s", err) - } else { - tempProfile, err := c.GetActiveProfile() - if err != nil { - log.Infof("%s", err) - } else { - p = tempProfile - } - } + p := &scw.Profile{} + c, err := scw.LoadConfig() + if err != nil { + log.Warnf("Cannot load config: %v", err) + } else { + p, err = c.GetActiveProfile() + if err != nil { + log.Warnf("Cannot get active profile: %v", err) + } + } scwClient, err := scw.NewClient( scw.WithProfile(p),