Skip to content

feat: Modules v2 support#489

Merged
disq merged 12 commits intocloudquery:mainfrom
disq:feat/modules-v2
Feb 16, 2022
Merged

feat: Modules v2 support#489
disq merged 12 commits intocloudquery:mainfrom
disq:feat/modules-v2

Conversation

@disq
Copy link
Copy Markdown
Member

@disq disq commented Feb 14, 2022

No description provided.

@github-actions github-actions bot added the feat label Feb 14, 2022
@disq disq requested a review from roneli February 14, 2022 15:35
Copy link
Copy Markdown
Contributor

@roneli roneli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments on modules v2 support

@disq disq requested a review from roneli February 15, 2022 15:13
Copy link
Copy Markdown
Contributor

@roneli roneli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines +164 to +182
if l := len(unsupportingProviders); l == 1 {
return 0, nil, fmt.Errorf("provider %s doesn't support %s yet", unsupportingProviders[0], mod.ID())
} else if l > 1 {
return 0, nil, fmt.Errorf("providers %s don't support %s yet", strings.Join(unsupportingProviders, ", "), mod.ID())
}

if l := len(olderProviders); l == 1 {
return 0, nil, fmt.Errorf("provider %s seems to support an older version of %s, which is incompatible with your cloudquery version", olderProviders[0], mod.ID())
} else if l > 1 {
return 0, nil, fmt.Errorf("providers %s seem to support an older version of %s, which is incompatible with your cloudquery version", strings.Join(olderProviders, ", "), mod.ID())
}

if l := len(newerProviders); l == 1 {
return 0, nil, fmt.Errorf("provider %s seems to support a newer version of %s, which is incompatible with your cloudquery version", newerProviders[0], mod.ID())
} else if l > 1 {
return 0, nil, fmt.Errorf("providers %s seem to support a newer version of %s, which is incompatible with your cloudquery version", strings.Join(newerProviders, ", "), mod.ID())
}

return 0, nil, fmt.Errorf("version mismatch between module and providers, please upgrade your providers and/or cloudquery")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: put this in a function?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, simplified and added test

@disq disq merged commit b4c4d2c into cloudquery:main Feb 16, 2022
@disq disq deleted the feat/modules-v2 branch February 16, 2022 09:18
TinLe pushed a commit to TinLe/cloudquery that referenced this pull request Feb 22, 2022
* upstream/main:
  feat: Policy Snapshot Testing (cloudquery#449)
  fix: Remove enable_partial_fetch and support for migrationless providers (cloudquery#495)
  fix: Upgrade schema in history mode (cloudquery#494)
  fix: Don't report unmanaged provider diags to sentry (cloudquery#492)
  feat: Modules v2 support (cloudquery#489)
  chore: Synced local '.github/dependabot.yml' with remote 'dependabot.yml' (cloudquery#490)
  chore: Remove '--debug' flag from issue template (cloudquery#488)
  fix: Don't return an error if encountering an empty subpolicy (cloudquery#486)
  fix: Fetch summary SQL state 54000 (cloudquery#487)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants