Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func NewApplicationSnapshotImage(ctx context.Context, image string, publicKey st
log.Debugf("%s", policyRepoJson)
}

c, err := newConftestEvaluator(policies, []string{ConftestNamespace})
c, err := newConftestEvaluator(policies, ConftestNamespace)
if err != nil {
log.Debug("Failed to initialize the conftest evaluator!")
return nil, err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func NewPipelineDefinitionFile(ctx context.Context, fpath string, policyRepo sou
p := &DefinitionFile{
Fpath: fpath,
}
c, err := newConftestEvaluator([]source.PolicySource{&policyRepo}, []string{namespace})
c, err := newConftestEvaluator([]source.PolicySource{&policyRepo}, namespace)
if err != nil {
return nil, err
}
Expand Down
8 changes: 4 additions & 4 deletions internal/evaluator/conftest_evaluator.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type conftestEvaluator struct {
policySources []source.PolicySource
paths ConfigurationPaths
testRunner runner.TestRunner
namespace []string
namespace string
outputFormat string
workDir string
}
Expand All @@ -50,11 +50,11 @@ type ConfigurationPaths struct {

// NewConftestEvaluator returns initialized conftestEvaluator implementing
// Evaluator interface
func NewConftestEvaluator(policySources []source.PolicySource, namespaces []string) (Evaluator, error) {
func NewConftestEvaluator(policySources []source.PolicySource, namespace string) (Evaluator, error) {
c := conftestEvaluator{
policySources: policySources,
paths: ConfigurationPaths{},
namespace: namespaces,
namespace: namespace,
outputFormat: "json",
}

Expand Down Expand Up @@ -83,7 +83,7 @@ func NewConftestEvaluator(policySources []source.PolicySource, namespaces []stri
c.testRunner = runner.TestRunner{
Data: c.paths.DataPaths,
Policy: c.paths.PolicyPaths,
Namespace: c.namespace,
Namespace: []string{c.namespace},
NoFail: true,
Output: c.outputFormat,
}
Expand Down