Start by reading IaC before enumerate cloud resources

Ensure IaC source are valid prevent us to fail after a potentially long
running cloud resources scan.
main
Elie 2021-01-08 12:10:25 +01:00
parent d3c1e72427
commit 5e6288000f
No known key found for this signature in database
GPG Key ID: 399AF69092C727B6
1 changed files with 6 additions and 6 deletions

View File

@ -89,17 +89,17 @@ func (d DriftCTL) Stop() {
} }
func (d DriftCTL) scan() (remoteResources []resource.Resource, resourcesFromState []resource.Resource, err error) { func (d DriftCTL) scan() (remoteResources []resource.Resource, resourcesFromState []resource.Resource, err error) {
logrus.Info("Start scanning cloud provider")
remoteResources, err = d.remoteSupplier.Resources()
if err != nil {
return nil, nil, err
}
logrus.Info("Start reading terraform state") logrus.Info("Start reading terraform state")
resourcesFromState, err = d.iacSupplier.Resources() resourcesFromState, err = d.iacSupplier.Resources()
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
} }
logrus.Info("Start scanning cloud provider")
remoteResources, err = d.remoteSupplier.Resources()
if err != nil {
return nil, nil, err
}
return remoteResources, resourcesFromState, err return remoteResources, resourcesFromState, err
} }