From d4d56c394daed318b912252549c0f155c6f93291 Mon Sep 17 00:00:00 2001 From: Dominik Richter Date: Fri, 20 Oct 2023 03:11:12 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20simplify=20default=20provider=20?= =?UTF-8?q?install=20(#868)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🧹 simplify default provider install Requires https://github.com/mondoohq/cnquery/pull/2306 Uses provider IDs instead of other (confusing) means, after I finally cleaned up my original code. Signed-off-by: Dominik Richter * 🧹 cnquery 9.2.3 --------- Signed-off-by: Dominik Richter Co-authored-by: Christoph Hartmann --- apps/cnspec/cmd/bundle.go | 11 ++--------- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/apps/cnspec/cmd/bundle.go b/apps/cnspec/cmd/bundle.go index 67145aeb..78518add 100644 --- a/apps/cnspec/cmd/bundle.go +++ b/apps/cnspec/cmd/bundle.go @@ -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 } } diff --git a/go.mod b/go.mod index d8cd4c53..1f17034b 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index cc47e921..593de9e1 100644 --- a/go.sum +++ b/go.sum @@ -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=