Skip to content

Commit

Permalink
fixes for linter
Browse files Browse the repository at this point in the history
Signed-off-by: Issif <issif_github@gadz.org>
  • Loading branch information
Issif committed Jan 10, 2021
1 parent 91db486 commit 8561a8b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
8 changes: 4 additions & 4 deletions outputs/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func (c *Client) Post(payload interface{}) error {
log.Printf("[ERROR] : %v - %v\n", c.OutputType, err.Error())
}
contentType := "application/json; charset=utf-8"
if c.OutputType == "Loki" || c.OutputType == "Kubeless" {
if c.OutputType == "Loki" || c.OutputType == Kubeless {
contentType = "application/json"
}
req.Header.Add("Content-Type", contentType)
Expand All @@ -128,7 +128,7 @@ func (c *Client) Post(payload interface{}) error {
req.Header.Add("Authorization", "GenieKey "+c.Config.Opsgenie.APIKey)
}

if c.OutputType == "Kubeless" {
if c.OutputType == Kubeless {
b := make([]byte, 11)
rand.Read(b)
base64.RawURLEncoding.EncodeToString(b)
Expand Down Expand Up @@ -158,9 +158,9 @@ func (c *Client) Post(payload interface{}) error {
switch resp.StatusCode {
case http.StatusOK, http.StatusCreated, http.StatusAccepted, http.StatusNoContent: //200, 201, 202, 204
log.Printf("[INFO] : %v - Post OK (%v)\n", c.OutputType, resp.StatusCode)
if c.OutputType == "Kubeless" {
if c.OutputType == Kubeless {
body, _ := ioutil.ReadAll(resp.Body)
log.Printf("[INFO] : Kubeless - Function Reponse : %v\n", string(body))
log.Printf("[INFO] : Kubeless - Function Response : %v\n", string(body))
}
return nil
case http.StatusBadRequest: //400
Expand Down
2 changes: 2 additions & 0 deletions outputs/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@ const (
LigthBlue string = "#68c2ff"
Lightcyan string = "#5bffb5"
Orange string = "#ff5400"

Kubeless string = "Kubeless"
)
2 changes: 1 addition & 1 deletion outputs/kubeless.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (c *Client) KubelessCall(falcopayload types.FalcoPayload) {
log.Printf("[ERROR] : Kubeless - %v\n", err)
return
}
log.Printf("[INFO] : Kubeless - Function Reponse : %v\n", string(string(rawbody)))
log.Printf("[INFO] : Kubeless - Function Response : %v\n", string(rawbody))
} else {
err := c.Post(falcopayload)
if err != nil {
Expand Down

0 comments on commit 8561a8b

Please sign in to comment.