Skip to content

Commit

Permalink
loadtester: release v0.16.0
Browse files Browse the repository at this point in the history
- update helm to 2.16.5
- update helmv3 to 3.1.2
- remove http server timeouts
  • Loading branch information
stefanprodan committed Mar 31, 2020
1 parent b14bcc4 commit 1ffe0a3
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Dockerfile.loadtester
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ RUN apk --no-cache add alpine-sdk perl curl
RUN curl -sSLo hey "https://storage.googleapis.com/hey-release/hey_linux_amd64" && \
chmod +x hey && mv hey /usr/local/bin/hey

RUN HELM2_VERSION=2.16.3 && \
RUN HELM2_VERSION=2.16.5 && \
curl -sSL "https://get.helm.sh/helm-v${HELM2_VERSION}-linux-amd64.tar.gz" | tar xvz && \
chmod +x linux-amd64/helm && mv linux-amd64/helm /usr/local/bin/helm && \
chmod +x linux-amd64/tiller && mv linux-amd64/tiller /usr/local/bin/tiller

RUN HELM3_VERSION=3.1.1 && \
RUN HELM3_VERSION=3.1.2 && \
curl -sSL "https://get.helm.sh/helm-v${HELM3_VERSION}-linux-amd64.tar.gz" | tar xvz && \
chmod +x linux-amd64/helm && mv linux-amd64/helm /usr/local/bin/helmv3

Expand Down
4 changes: 2 additions & 2 deletions charts/loadtester/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
name: loadtester
version: 0.15.0
appVersion: 0.15.0
version: 0.16.0
appVersion: 0.16.0
kubeVersion: ">=1.11.0-0"
engine: gotpl
description: Flagger's load testing services based on rakyll/hey and bojand/ghz that generates traffic during canary analysis when configured as a webhook.
Expand Down
2 changes: 1 addition & 1 deletion cmd/loadtester/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"go.uber.org/zap"
)

var VERSION = "0.15.0"
var VERSION = "0.16.0"
var (
logLevel string
port string
Expand Down
2 changes: 1 addition & 1 deletion kustomize/tester/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
spec:
containers:
- name: loadtester
image: weaveworks/flagger-loadtester:0.15.0
image: weaveworks/flagger-loadtester:0.16.0
imagePullPolicy: IfNotPresent
ports:
- name: http
Expand Down
11 changes: 4 additions & 7 deletions pkg/loadtester/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,6 @@ func ListenAndServe(port string, timeout time.Duration, logger *zap.SugaredLogge
srv := &http.Server{
Addr: ":" + port,
Handler: mux,
ReadTimeout: 5 * time.Second,
WriteTimeout: timeout,
IdleTimeout: 15 * time.Second,
}

// run server in background
Expand Down Expand Up @@ -250,11 +247,11 @@ func HandleNewTask(logger *zap.SugaredLogger, taskRunner TaskRunnerInterface) fu
rtnCmdOutput, err = strconv.ParseBool(rtn)
}

// run bats command (blocking task)
// run bash command (blocking task)
if typ == TaskTypeBash {
logger.With("canary", payload.Name).Infof("bats command %s", payload.Metadata["cmd"])
logger.With("canary", payload.Name).Infof("bash command %s", payload.Metadata["cmd"])

bats := BashTask{
bashTask := BashTask{
command: payload.Metadata["cmd"],
logCmdOutput: true,
TaskBase: TaskBase{
Expand All @@ -266,7 +263,7 @@ func HandleNewTask(logger *zap.SugaredLogger, taskRunner TaskRunnerInterface) fu
ctx, cancel := context.WithTimeout(context.Background(), taskRunner.Timeout())
defer cancel()

result, err := bats.Run(ctx)
result, err := bashTask.Run(ctx)
if !result.ok {
w.WriteHeader(http.StatusInternalServerError)
w.Write([]byte(err.Error()))
Expand Down

0 comments on commit 1ffe0a3

Please sign in to comment.