Skip to content

Commit

Permalink
🧹 simplify default provider install
Browse files Browse the repository at this point in the history
Requires mondoohq/cnquery#2306

Uses provider IDs instead of other (confusing) means, after I finally
cleaned up my original code.

Signed-off-by: Dominik Richter <[email protected]>
  • Loading branch information
arlimus committed Oct 20, 2023
1 parent d6292fa commit 81c0ca9
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions apps/cnspec/cmd/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,8 @@ func init() {

// ensureProviders ensures that all providers are locally installed
func ensureProviders() error {
providerList := []string{}

for k := range providers.DefaultProviders {
providerList = append(providerList, k)
}

// ensure that the providers are loaded
for _, connectionName := range providerList {
if _, err := providers.EnsureProvider(connectionName, "", true, nil); err != nil {
for _, v := range providers.DefaultProviders {
if _, err := providers.EnsureProvider(providers.ProviderLookup{ID: v.ID}, true, nil); err != nil {

Check failure on line 51 in apps/cnspec/cmd/bundle.go

View workflow job for this annotation

GitHub Actions / golangci-lint

undefined: providers.ProviderLookup

Check failure on line 51 in apps/cnspec/cmd/bundle.go

View workflow job for this annotation

GitHub Actions / golangci-lint

not enough arguments in call to providers.EnsureProvider

Check failure on line 51 in apps/cnspec/cmd/bundle.go

View workflow job for this annotation

GitHub Actions / golangci-lint

undefined: providers.ProviderLookup

Check failure on line 51 in apps/cnspec/cmd/bundle.go

View workflow job for this annotation

GitHub Actions / golangci-lint

not enough arguments in call to providers.EnsureProvider

Check failure on line 51 in apps/cnspec/cmd/bundle.go

View workflow job for this annotation

GitHub Actions / golangci-lint

undefined: providers.ProviderLookup

Check failure on line 51 in apps/cnspec/cmd/bundle.go

View workflow job for this annotation

GitHub Actions / golangci-lint

not enough arguments in call to providers.EnsureProvider

Check failure on line 51 in apps/cnspec/cmd/bundle.go

View workflow job for this annotation

GitHub Actions / go-test

undefined: providers.ProviderLookup

Check failure on line 51 in apps/cnspec/cmd/bundle.go

View workflow job for this annotation

GitHub Actions / go-test

not enough arguments in call to providers.EnsureProvider

Check failure on line 51 in apps/cnspec/cmd/bundle.go

View workflow job for this annotation

GitHub Actions / go-test

undefined: providers.ProviderLookup

Check failure on line 51 in apps/cnspec/cmd/bundle.go

View workflow job for this annotation

GitHub Actions / go-test

not enough arguments in call to providers.EnsureProvider
return err
}
}
Expand Down

0 comments on commit 81c0ca9

Please sign in to comment.