Skip to content

Commit

Permalink
lowercase outputs
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Labarussias <issif+github@gadz.org>
  • Loading branch information
Issif committed Jan 25, 2024
1 parent 8a5c8ac commit 1b94bad
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion actionners/kubernetes/labelize/labelize.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ var Labelize = func(rule *rules.Rule, action *rules.Action, event *events.Event)
}
return utils.LogLine{
Objects: objects,
Output: fmt.Sprintf("The Pod '%v' in the Namespace '%v' has been labelized", pod, namespace),
Output: fmt.Sprintf("the pod '%v' in the namespace '%v' has been labelized", pod, namespace),
Status: "success",
},
nil
Expand Down
4 changes: 2 additions & 2 deletions actionners/kubernetes/networkpolicy/networkpolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,10 @@ var NetworkPolicy = func(rule *rules.Rule, action *rules.Action, event *events.E
_, err = client.NetworkingV1().NetworkPolicies(namespace).Get(context.Background(), owner, metav1.GetOptions{})
if errorsv1.IsNotFound(err) {
_, err = client.NetworkingV1().NetworkPolicies(namespace).Create(context.Background(), &payload, metav1.CreateOptions{})
output = fmt.Sprintf("The NetworkPolicy '%v' in the Namespace '%v' has been created", owner, namespace)
output = fmt.Sprintf("the networkpolicy '%v' in the namespace '%v' has been created", owner, namespace)
} else {
_, err = client.NetworkingV1().NetworkPolicies(namespace).Update(context.Background(), &payload, metav1.UpdateOptions{})
output = fmt.Sprintf("The NetworkPolicy '%v' in the Namespace '%v' has been updated", owner, namespace)
output = fmt.Sprintf("the networkpolicy '%v' in the namespace '%v' has been updated", owner, namespace)
}
if err != nil {
return utils.LogLine{
Expand Down
2 changes: 1 addition & 1 deletion actionners/kubernetes/terminate/terminate.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ var Terminate = func(rule *rules.Rule, action *rules.Action, event *events.Event
}
return utils.LogLine{
Objects: objects,
Output: fmt.Sprintf("The Pod '%v' in the Namespace '%v' has been terminated", podName, namespace),
Output: fmt.Sprintf("the pod '%v' in the namespace '%v' has been terminated", podName, namespace),
Status: "success",
},
nil
Expand Down
2 changes: 1 addition & 1 deletion utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func SetFields(structure interface{}, fields map[string]interface{}) interface{}
if fields[field] != nil {
switch valueOf.Type().Field(i).Type.String() {
case StringStr:
valueOf.Field(i).SetString(fields[field].(string))
valueOf.Field(i).SetString(fmt.Sprint(fields[field]))
case IntStr, Int64Str:
d := int64(fields[field].(int))
valueOf.Field(i).SetInt(d)
Expand Down

0 comments on commit 1b94bad

Please sign in to comment.