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:
parent
67a2466c32
commit
e16d773957
6 changed files with 3 additions and 16 deletions
|
@ -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 {
|
||||
|
|
|
@ -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] == ')'
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -38,7 +38,6 @@ type Interface interface {
|
|||
type Config struct {
|
||||
name string
|
||||
namespace string
|
||||
id string
|
||||
startWork func()
|
||||
stopWork func()
|
||||
kubeClient kubernetes.Interface
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
|
|
|
@ -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")
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue