1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-29 10:55:05 +00:00

Remove unused function (#2517)

This commit is contained in:
Sachin 2021-10-11 12:46:28 -07:00 committed by GitHub
parent 67a2466c32
commit e16d773957
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 3 additions and 16 deletions

View file

@ -227,11 +227,11 @@ func applyOverlayToMap(resourceMap, overlayMap map[string]interface{}, path stri
func applyOverlayToArray(resource, overlay []interface{}, path string) ([][]byte, error) {
var appliedPatches [][]byte
if 0 == len(overlay) {
if len(overlay) == 0 {
return nil, errors.New("Empty array detected in the overlay")
}
if 0 == len(resource) {
if len(resource) == 0 {
// If array resource is empty, insert part from overlay
patch, err := insertSubtree(overlay, path)
if err != nil {

View file

@ -8,7 +8,6 @@ import (
"github.com/go-logr/logr"
"github.com/kyverno/kyverno/pkg/engine/anchor"
"github.com/kyverno/kyverno/pkg/engine/common"
"github.com/kyverno/kyverno/pkg/engine/operator"
"github.com/kyverno/kyverno/pkg/engine/wildcards"
)
@ -241,11 +240,3 @@ func validateArrayOfMaps(log logr.Logger, resourceMapArray []interface{}, patter
}
return "", nil
}
func isStringIsReference(str string) bool {
if len(str) < len(operator.ReferenceSign) {
return false
}
return str[0] == '$' && str[1] == '(' && str[len(str)-1] == ')'
}

View file

@ -1562,7 +1562,7 @@ func Test_Eval_Equal_Var_Pass(t *testing.T) {
err = json.Unmarshal(conditionJSON, &conditionMap)
assert.Nil(t, err)
conditionWithResolvedVars, err := SubstituteAllInPreconditions(log.Log, ctx, conditionMap)
conditionWithResolvedVars, _ := SubstituteAllInPreconditions(log.Log, ctx, conditionMap)
conditionJSON, err = json.Marshal(conditionWithResolvedVars)
assert.Nil(t, err)

View file

@ -38,7 +38,6 @@ type Interface interface {
type Config struct {
name string
namespace string
id string
startWork func()
stopWork func()
kubeClient kubernetes.Interface

View file

@ -1,4 +1,3 @@
#!/bin/sh
set -e

View file

@ -19,8 +19,6 @@ var (
policyGVR = e2e.GetGVR("kyverno.io", "v1", "clusterpolicies")
// Namespace GVR
namespaceGVR = e2e.GetGVR("", "v1", "namespaces")
// ConfigMap GVR
cmGVR = e2e.GetGVR("", "v1", "configmaps")
crdGVR = e2e.GetGVR("apiextensions.k8s.io", "v1", "customresourcedefinitions")