Skip to content

Commit

Permalink
kubearmour improvements
Browse files Browse the repository at this point in the history
Signed-off-by: prady0t <[email protected]>
  • Loading branch information
prady0t committed Nov 10, 2024
1 parent e279e50 commit 6750842
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions KubeArmor/policy/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,16 @@ func (p *PolicyServer) ContainerPolicy(c context.Context, data *pb.Policy) (*pb.
res.Status = pb.PolicyStatus_Invalid
kg.Warn("Empty Container Policy Event")
}

return res, nil

} else {

kg.Warn("Invalid Container Policy Event")

res.Status = pb.PolicyStatus_Invalid
return res, err
}

Check warning on line 54 in KubeArmor/policy/policy.go

View workflow job for this annotation

GitHub Actions / go-lint

if block ends with a return statement, so drop this else and outdent its block

return res, nil
}

// HostPolicy accepts host policy event on gRPC service and updates host security policies. It responds with 1 if success else 0.
Expand All @@ -78,11 +79,12 @@ func (p *PolicyServer) HostPolicy(c context.Context, data *pb.Policy) (*pb.Respo
res.Status = pb.PolicyStatus_Invalid

}
return res, nil

} else {
kg.Warn("Invalid Host Policy Event")
res.Status = pb.PolicyStatus_Invalid
return res, err
}

Check warning on line 88 in KubeArmor/policy/policy.go

View workflow job for this annotation

GitHub Actions / go-lint

if block ends with a return statement, so drop this else and outdent its block

return res, nil
}

0 comments on commit 6750842

Please sign in to comment.