Skip to content

Commit

Permalink
🐛 fix incorrect os-connection + 🧹 add os builtin (#1750)
Browse files Browse the repository at this point in the history
- 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 <[email protected]>
  • Loading branch information
arlimus authored Sep 17, 2023
1 parent 1dba621 commit 7907256
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
15 changes: 15 additions & 0 deletions providers-sdk/v1/util/configure/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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
}
`
Expand Down
15 changes: 15 additions & 0 deletions providers/builtin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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,
// },
}
1 change: 0 additions & 1 deletion providers/os/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ var Config = plugin.Provider{
ConnectionTypes: []string{
provider.LocalConnectionType,
provider.SshConnectionType,
provider.MockConnectionType,
provider.TarConnectionType,
provider.DockerSnapshotConnectionType,
provider.VagrantConnectionType,
Expand Down

0 comments on commit 7907256

Please sign in to comment.