1
0
Fork 0
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:
Shuting Zhao 2020-01-10 18:31:43 -08:00
parent f618bbcff3
commit 4eff0e9a8c

View file

@ -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) {