Skip to content

Commit

Permalink
make AppendResolvedField a no-op outside of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcacheux committed Nov 28, 2024
1 parent 5d33704 commit a368789
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 8 deletions.
8 changes: 0 additions & 8 deletions pkg/security/secl/compiler/eval/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,6 @@ func (c *Context) Reset() {
clear(c.resolvedFields)
}

func (c *Context) AppendResolvedField(field string) {
if field == "" {
return
}

c.resolvedFields = append(c.resolvedFields, field)
}

func (c *Context) GetResolvedFields() []string {
return c.resolvedFields
}
Expand Down
18 changes: 18 additions & 0 deletions pkg/security/secl/compiler/eval/context_funtests.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-present Datadog, Inc.

//go:build functionaltests

// Package eval holds eval related files
package eval

// AppendResolvedField instructs the context that this field has been resolved
func (c *Context) AppendResolvedField(field string) {
if field == "" {
return
}

c.resolvedFields = append(c.resolvedFields, field)
}
13 changes: 13 additions & 0 deletions pkg/security/secl/compiler/eval/context_regular.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-present Datadog, Inc.

//go:build !functionaltests

// Package eval holds eval related files
package eval

// AppendResolvedField is a no-op outside of functional tests
func (c *Context) AppendResolvedField(_ string) {
}

0 comments on commit a368789

Please sign in to comment.