Skip to content

Commit

Permalink
Add Iris User-Agent (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
CKarper authored and olegsu committed Aug 11, 2019
1 parent 4657dde commit 0eb14d6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.1
0.5.0
2 changes: 1 addition & 1 deletion pkg/destination/codefresh_destination.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (d *codefreshDestination) Exec(payload interface{}) {
d.logger.Debug("Executing Codefresh destination\n")
req, _ := http.NewRequest("POST", url, contentReader)
req.Header.Set("authorization", d.CFToken)
req.Header.Set("User-Agent", "IRIS")
req.Header.Set("User-Agent", UserAgent)
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
Expand Down
1 change: 1 addition & 0 deletions pkg/destination/default_destination.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ func (d *defaultDestination) Exec(payload interface{}) {
req, _ := http.NewRequest("POST", d.URL, contentReader)
req.Header.Set("X-IRIS-HMAC", getHmac(d.Secret, mJSON))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("User-Agent", UserAgent)
client := &http.Client{}
client.Do(req)
}
5 changes: 5 additions & 0 deletions pkg/destination/destination.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@ import (
"github.com/olegsu/iris/pkg/kube"
"github.com/olegsu/iris/pkg/logger"
"github.com/olegsu/iris/pkg/util"
"os"
)

const (
TypeDefault = ""
TypeCodefresh = "codefresh"
)

var (
UserAgent = "iris/" + os.Getenv("IRIS_VERSION")
)

type Destination interface {
GetName() string
Exec(payload interface{})
Expand Down

0 comments on commit 0eb14d6

Please sign in to comment.