From 790725618ed80ebe95dbe2383278671f87ce65ae Mon Sep 17 00:00:00 2001 From: Dominik Richter Date: Sat, 16 Sep 2023 22:35:23 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20incorrect=20os-connection?= =?UTF-8?q?=20+=20=F0=9F=A7=B9=20add=20os=20builtin=20(#1750)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - the os provider does not support the mock connection - add back the builtin comments for the os provider, since we still use it (until it gets wired into its own go.mod) Signed-off-by: Dominik Richter --- providers-sdk/v1/util/configure/configure.go | 15 +++++++++++++++ providers/builtin.go | 15 +++++++++++++++ providers/os/config/config.go | 1 - 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/providers-sdk/v1/util/configure/configure.go b/providers-sdk/v1/util/configure/configure.go index 77eb1b50bb..715ab767ca 100644 --- a/providers-sdk/v1/util/configure/configure.go +++ b/providers-sdk/v1/util/configure/configure.go @@ -107,11 +107,16 @@ import ( coreconf "go.mondoo.com/cnquery/providers/core/config" core "go.mondoo.com/cnquery/providers/core/provider" + // osconf "go.mondoo.com/cnquery/providers/os/config" + // os "go.mondoo.com/cnquery/providers/os/provider" %s) //go:embed core/resources/core.resources.json var coreInfo []byte +// //go:embed os/resources/os.resources.json +// var osInfo []byte + %s var builtinProviders = map[string]*builtinProvider{ coreconf.Config.ID: { @@ -124,6 +129,16 @@ var builtinProviders = map[string]*builtinProvider{ }, Config: &coreconf.Config, }, + // osconf.Config.ID: { + // Runtime: &RunningProvider{ + // Name: osconf.Config.Name, + // ID: osconf.Config.ID, + // Plugin: os.Init(), + // Schema: MustLoadSchema("os", osInfo), + // isClosed: false, + // }, + // Config: &osconf.Config, + // }, %s } ` diff --git a/providers/builtin.go b/providers/builtin.go index 94023e95cd..8fbc4b4639 100644 --- a/providers/builtin.go +++ b/providers/builtin.go @@ -15,11 +15,16 @@ import ( coreconf "go.mondoo.com/cnquery/providers/core/config" core "go.mondoo.com/cnquery/providers/core/provider" + // osconf "go.mondoo.com/cnquery/providers/os/config" + // os "go.mondoo.com/cnquery/providers/os/provider" ) //go:embed core/resources/core.resources.json var coreInfo []byte +// //go:embed os/resources/os.resources.json +// var osInfo []byte + var builtinProviders = map[string]*builtinProvider{ coreconf.Config.ID: { Runtime: &RunningProvider{ @@ -31,4 +36,14 @@ var builtinProviders = map[string]*builtinProvider{ }, Config: &coreconf.Config, }, + // osconf.Config.ID: { + // Runtime: &RunningProvider{ + // Name: osconf.Config.Name, + // ID: osconf.Config.ID, + // Plugin: os.Init(), + // Schema: MustLoadSchema("os", osInfo), + // isClosed: false, + // }, + // Config: &osconf.Config, + // }, } diff --git a/providers/os/config/config.go b/providers/os/config/config.go index f46d882a2c..23e6046637 100644 --- a/providers/os/config/config.go +++ b/providers/os/config/config.go @@ -15,7 +15,6 @@ var Config = plugin.Provider{ ConnectionTypes: []string{ provider.LocalConnectionType, provider.SshConnectionType, - provider.MockConnectionType, provider.TarConnectionType, provider.DockerSnapshotConnectionType, provider.VagrantConnectionType,