mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
performed cleanups (#1552)
This commit is contained in:
parent
2f2d6c2e38
commit
d141f74015
4 changed files with 7 additions and 11 deletions
|
@ -245,10 +245,6 @@ func applyPoliciesFromPath(fs billy.Filesystem, policyBytes []byte, valuesFile s
|
||||||
fmt.Printf("Error: failed to load resources\nCause: %s\n", err)
|
fmt.Printf("Error: failed to load resources\nCause: %s\n", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
if err != nil {
|
|
||||||
fmt.Printf("Error: failed to load resources\nCause: %s\n", err)
|
|
||||||
os.Exit(1)
|
|
||||||
}
|
|
||||||
msgPolicies := "1 policy"
|
msgPolicies := "1 policy"
|
||||||
if len(mutatedPolicies) > 1 {
|
if len(mutatedPolicies) > 1 {
|
||||||
msgPolicies = fmt.Sprintf("%d policies", len(policies))
|
msgPolicies = fmt.Sprintf("%d policies", len(policies))
|
||||||
|
|
|
@ -92,7 +92,7 @@ func generateDebugMutatingWebhook(name, url string, caData []byte, validate bool
|
||||||
},
|
},
|
||||||
SideEffects: &sideEffect,
|
SideEffects: &sideEffect,
|
||||||
Rules: []admregapi.RuleWithOperations{
|
Rules: []admregapi.RuleWithOperations{
|
||||||
admregapi.RuleWithOperations{
|
{
|
||||||
Operations: operationTypes,
|
Operations: operationTypes,
|
||||||
Rule: admregapi.Rule{
|
Rule: admregapi.Rule{
|
||||||
APIGroups: []string{
|
APIGroups: []string{
|
||||||
|
@ -122,7 +122,7 @@ func generateDebugValidatingWebhook(name, url string, caData []byte, validate bo
|
||||||
},
|
},
|
||||||
SideEffects: &sideEffect,
|
SideEffects: &sideEffect,
|
||||||
Rules: []admregapi.RuleWithOperations{
|
Rules: []admregapi.RuleWithOperations{
|
||||||
admregapi.RuleWithOperations{
|
{
|
||||||
Operations: operationTypes,
|
Operations: operationTypes,
|
||||||
Rule: admregapi.Rule{
|
Rule: admregapi.Rule{
|
||||||
APIGroups: []string{
|
APIGroups: []string{
|
||||||
|
@ -195,7 +195,7 @@ func generateValidatingWebhook(name, servicePath string, caData []byte, validati
|
||||||
},
|
},
|
||||||
SideEffects: &sideEffect,
|
SideEffects: &sideEffect,
|
||||||
Rules: []admregapi.RuleWithOperations{
|
Rules: []admregapi.RuleWithOperations{
|
||||||
admregapi.RuleWithOperations{
|
{
|
||||||
Operations: operationTypes,
|
Operations: operationTypes,
|
||||||
Rule: admregapi.Rule{
|
Rule: admregapi.Rule{
|
||||||
APIGroups: []string{
|
APIGroups: []string{
|
||||||
|
|
|
@ -217,7 +217,7 @@ func stripNonPolicyFields(obj, newRes map[string]interface{}, logger logr.Logger
|
||||||
keyInData := make([]string, 0)
|
keyInData := make([]string, 0)
|
||||||
switch dataMap.(type) {
|
switch dataMap.(type) {
|
||||||
case map[string]interface{}:
|
case map[string]interface{}:
|
||||||
for k, _ := range dataMap.(map[string]interface{}) {
|
for k := range dataMap.(map[string]interface{}) {
|
||||||
keyInData = append(keyInData, k)
|
keyInData = append(keyInData, k)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ func Test_updateFeildsInSourceAndUpdatedResource(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
testcases := []TestCase{
|
testcases := []TestCase{
|
||||||
TestCase{
|
{
|
||||||
obj: map[string]interface{}{
|
obj: map[string]interface{}{
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
"data": map[string]interface{}{
|
"data": map[string]interface{}{
|
||||||
|
@ -75,7 +75,7 @@ func Test_updateFeildsInSourceAndUpdatedResource(t *testing.T) {
|
||||||
"metadata": map[string]interface{}{},
|
"metadata": map[string]interface{}{},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
TestCase{
|
{
|
||||||
obj: map[string]interface{}{
|
obj: map[string]interface{}{
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
"data": map[string]interface{}{
|
"data": map[string]interface{}{
|
||||||
|
@ -150,7 +150,7 @@ func Test_updateFeildsInSourceAndUpdatedResource(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
TestCase{
|
{
|
||||||
obj: map[string]interface{}{
|
obj: map[string]interface{}{
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
"kind": "Pod",
|
"kind": "Pod",
|
||||||
|
|
Loading…
Reference in a new issue