Skip to content

Commit

Permalink
performed cleanups (#1552)
Browse files Browse the repository at this point in the history
  • Loading branch information
yashvardhan-kukreja committed Feb 8, 2021
1 parent 2f2d6c2 commit d141f74
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
4 changes: 0 additions & 4 deletions pkg/kyverno/test/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,6 @@ func applyPoliciesFromPath(fs billy.Filesystem, policyBytes []byte, valuesFile s
fmt.Printf("Error: failed to load resources\nCause: %s\n", err)
os.Exit(1)
}
if err != nil {
fmt.Printf("Error: failed to load resources\nCause: %s\n", err)
os.Exit(1)
}
msgPolicies := "1 policy"
if len(mutatedPolicies) > 1 {
msgPolicies = fmt.Sprintf("%d policies", len(policies))
Expand Down
6 changes: 3 additions & 3 deletions pkg/webhookconfig/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func generateDebugMutatingWebhook(name, url string, caData []byte, validate bool
},
SideEffects: &sideEffect,
Rules: []admregapi.RuleWithOperations{
admregapi.RuleWithOperations{
{
Operations: operationTypes,
Rule: admregapi.Rule{
APIGroups: []string{
Expand Down Expand Up @@ -122,7 +122,7 @@ func generateDebugValidatingWebhook(name, url string, caData []byte, validate bo
},
SideEffects: &sideEffect,
Rules: []admregapi.RuleWithOperations{
admregapi.RuleWithOperations{
{
Operations: operationTypes,
Rule: admregapi.Rule{
APIGroups: []string{
Expand Down Expand Up @@ -195,7 +195,7 @@ func generateValidatingWebhook(name, servicePath string, caData []byte, validati
},
SideEffects: &sideEffect,
Rules: []admregapi.RuleWithOperations{
admregapi.RuleWithOperations{
{
Operations: operationTypes,
Rule: admregapi.Rule{
APIGroups: []string{
Expand Down
2 changes: 1 addition & 1 deletion pkg/webhooks/generation.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func stripNonPolicyFields(obj, newRes map[string]interface{}, logger logr.Logger
keyInData := make([]string, 0)
switch dataMap.(type) {
case map[string]interface{}:
for k, _ := range dataMap.(map[string]interface{}) {
for k := range dataMap.(map[string]interface{}) {
keyInData = append(keyInData, k)
}
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/webhooks/generation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func Test_updateFeildsInSourceAndUpdatedResource(t *testing.T) {
}

testcases := []TestCase{
TestCase{
{
obj: map[string]interface{}{
"apiVersion": "v1",
"data": map[string]interface{}{
Expand Down Expand Up @@ -75,7 +75,7 @@ func Test_updateFeildsInSourceAndUpdatedResource(t *testing.T) {
"metadata": map[string]interface{}{},
},
},
TestCase{
{
obj: map[string]interface{}{
"apiVersion": "v1",
"data": map[string]interface{}{
Expand Down Expand Up @@ -150,7 +150,7 @@ func Test_updateFeildsInSourceAndUpdatedResource(t *testing.T) {
},
},
},
TestCase{
{
obj: map[string]interface{}{
"apiVersion": "v1",
"kind": "Pod",
Expand Down

0 comments on commit d141f74

Please sign in to comment.