Update provider/scaleway/scaleway.go

Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com>
This commit is contained in:
Ludovic Ortega 2023-11-17 09:43:50 +01:00 committed by GitHub
parent 1dc4690dcb
commit e542a62033
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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),