Skip to content

Commit

Permalink
🧹 simplify default provider install (#868)
Browse files Browse the repository at this point in the history
* 🧹 simplify default provider install

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]>

* 🧹 cnquery 9.2.3

---------

Signed-off-by: Dominik Richter <[email protected]>
Co-authored-by: Christoph Hartmann <[email protected]>
  • Loading branch information
arlimus and chris-rock authored Oct 20, 2023
1 parent 44be48f commit d4d56c3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 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 {
return err
}
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ require (
sigs.k8s.io/yaml v1.3.0
)

require go.mondoo.com/cnquery/v9 v9.2.1
require go.mondoo.com/cnquery/v9 v9.2.3

require (
4d63.com/gocheckcompilerdirectives v1.2.1 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -933,8 +933,8 @@ gitlab.com/bosi/decorder v0.4.1 h1:VdsdfxhstabyhZovHafFw+9eJ6eU0d2CkFNJcZz/NU4=
gitlab.com/bosi/decorder v0.4.1/go.mod h1:jecSqWUew6Yle1pCr2eLWTensJMmsxHsBwt+PVbkAqA=
go-simpler.org/assert v0.6.0 h1:QxSrXa4oRuo/1eHMXSBFHKvJIpWABayzKldqZyugG7E=
go-simpler.org/assert v0.6.0/go.mod h1:74Eqh5eI6vCK6Y5l3PI8ZYFXG4Sa+tkr70OIPJAUr28=
go.mondoo.com/cnquery/v9 v9.2.1 h1:ZFcHm/N9qbiVuqfvxtwE9z+0YLviZ500Cq0FdK4V0Tg=
go.mondoo.com/cnquery/v9 v9.2.1/go.mod h1:lBzCOIonmKRewB+o2trn7R6r4exONd9V6UJM600tHds=
go.mondoo.com/cnquery/v9 v9.2.3 h1:qPGNN8ry0vwEj4uJlSil3Wt672yxpRe1APWZ2TErv5E=
go.mondoo.com/cnquery/v9 v9.2.3/go.mod h1:lBzCOIonmKRewB+o2trn7R6r4exONd9V6UJM600tHds=
go.mondoo.com/ranger-rpc v0.5.2 h1:UrcVtMIinzfWsuSzZKibbMqcGZSARInKJi0Xs2AxXeU=
go.mondoo.com/ranger-rpc v0.5.2/go.mod h1:y5qqdFhOnSLKnAo8lXC0FKZoKLUYgLENvneww+q+7ws=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
Expand Down

0 comments on commit d4d56c3

Please sign in to comment.