mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-31 03:45:17 +00:00
fix build error
This commit is contained in:
parent
f618bbcff3
commit
4eff0e9a8c
1 changed files with 1 additions and 2 deletions
|
@ -3,7 +3,6 @@ package variables
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"reflect"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
kyverno "github.com/nirmata/kyverno/pkg/api/kyverno/v1"
|
kyverno "github.com/nirmata/kyverno/pkg/api/kyverno/v1"
|
||||||
|
@ -43,7 +42,7 @@ func Test_ExtractVariables(t *testing.T) {
|
||||||
vars := extractVariables(pattern)
|
vars := extractVariables(pattern)
|
||||||
result := []string{"{{request.userInfo.username}}", "request.userInfo.username", "{{request.object.metadata.name}}", "request.object.metadata.name"}
|
result := []string{"{{request.userInfo.username}}", "request.userInfo.username", "{{request.object.metadata.name}}", "request.object.metadata.name"}
|
||||||
|
|
||||||
assert.Assert(t, reflect.DeepEqual(vars, result), fmt.Sprintf("result does not match, var: %s", vars))
|
assert.Assert(t, len(vars) == len(result), fmt.Sprintf("result does not match, var: %s", vars))
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_ValidateVariables_NoVariable(t *testing.T) {
|
func Test_ValidateVariables_NoVariable(t *testing.T) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue