From d72ecd485389af1c8d66cfccf4178067926a8d44 Mon Sep 17 00:00:00 2001 From: Vyankatesh Kudtarkar Date: Wed, 27 Apr 2022 17:19:40 +0530 Subject: [PATCH] Fix test command git issue (#3692) Co-authored-by: shuting --- cmd/cli/kubectl-kyverno/test/test_command.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/cli/kubectl-kyverno/test/test_command.go b/cmd/cli/kubectl-kyverno/test/test_command.go index ae20537dc2..27ca9b52ca 100644 --- a/cmd/cli/kubectl-kyverno/test/test_command.go +++ b/cmd/cli/kubectl-kyverno/test/test_command.go @@ -6,6 +6,7 @@ import ( "io/ioutil" "net/url" "os" + "path" "path/filepath" "regexp" "sort" @@ -398,7 +399,7 @@ func testCommandExecute(dirPath []string, fileName string, gitBranch string, tes continue } - if file.Name() == fileName { + if path.Base(file.Name()) == fileName { testYamlCount++ policyresoucePath := strings.Trim(yamlFilePath, fileName) bytes, err := ioutil.ReadAll(file)