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
parent
d3c1e72427
commit
5e6288000f
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue