-
Notifications
You must be signed in to change notification settings - Fork 264
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
'check all' should not runs controls/benchmarks from dependency mods #…
- Loading branch information
1 parent
ecb5272
commit d836d4e
Showing
3 changed files
with
146 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package controlexecute | ||
|
||
import "github.com/turbot/steampipe/steampipeconfig/modconfig" | ||
|
||
// DirectChildrenModDecorator is a struct used to wrap a Mod but modify the results of GetChildren to only return | ||
// immediate mod children (as opposed to all resources in dependency mods as well) | ||
// This is needed when running 'check all' for a mod which has dependency mopds' | ||
type DirectChildrenModDecorator struct { | ||
Mod *modconfig.Mod | ||
} | ||
|
||
func (r DirectChildrenModDecorator) AddParent(item modconfig.ModTreeItem) error { | ||
return nil | ||
} | ||
|
||
func (r DirectChildrenModDecorator) GetChildren() []modconfig.ModTreeItem { | ||
var res []modconfig.ModTreeItem | ||
for _, child := range r.Mod.GetChildren() { | ||
if child.GetMod().Name() == r.Mod.Name() { | ||
res = append(res) | ||
} | ||
} | ||
return res | ||
} | ||
|
||
func (r DirectChildrenModDecorator) Name() string { | ||
return r.Mod.Name() | ||
} | ||
|
||
func (r DirectChildrenModDecorator) GetUnqualifiedName() string { | ||
return r.Mod.GetUnqualifiedName() | ||
} | ||
|
||
func (r DirectChildrenModDecorator) GetTitle() string { | ||
return r.Mod.GetTitle() | ||
} | ||
|
||
func (r DirectChildrenModDecorator) GetDescription() string { | ||
return r.Mod.GetDescription() | ||
} | ||
|
||
func (r DirectChildrenModDecorator) GetTags() map[string]string { | ||
return r.Mod.GetTags() | ||
} | ||
|
||
func (r DirectChildrenModDecorator) GetPaths() []modconfig.NodePath { | ||
return r.Mod.GetPaths() | ||
} | ||
|
||
func (r DirectChildrenModDecorator) SetPaths() { | ||
r.Mod.SetPaths() | ||
} | ||
|
||
func (r DirectChildrenModDecorator) GetMod() *modconfig.Mod { | ||
return r.Mod | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters