Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

Commit

Permalink
Bugfix: skip fetching if no resources specified
Browse files Browse the repository at this point in the history
  • Loading branch information
yevgenypats committed Mar 12, 2021
1 parent fd46794 commit c82b18d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,6 @@ var allRegions = []string{
}

func (p *Provider) validateFetchConfig() error {
if len(p.config.Resources) == 0 {
p.Logger.Warn("no resources specified. See available resources: see: https://docs.cloudquery.io/aws/tables-reference")
return nil
}

for _, r := range p.config.Resources {
resourcePath := strings.Split(r.Name, ".")
if len(resourcePath) != 2 {
Expand Down Expand Up @@ -287,7 +282,10 @@ func (p *Provider) Fetch(data []byte) error {
if err := yaml.Unmarshal(data, &p.config); err != nil {
return err
}

if len(p.config.Resources) == 0 {
p.Logger.Warn("no resources specified. See available resources: see: https://docs.cloudquery.io/aws/tables-reference")
return nil
}
if err := p.validateFetchConfig(); err != nil {
return err
}
Expand Down

0 comments on commit c82b18d

Please sign in to comment.