Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loadtester: release v0.16.0 #539

Merged
merged 1 commit into from
Mar 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
15 changes: 6 additions & 9 deletions pkg/loadtester/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,8 @@ func ListenAndServe(port string, timeout time.Duration, logger *zap.SugaredLogge

mux.HandleFunc("/", HandleNewTask(logger, taskRunner))
srv := &http.Server{
Addr: ":" + port,
Handler: mux,
ReadTimeout: 5 * time.Second,
WriteTimeout: timeout,
IdleTimeout: 15 * time.Second,
Addr: ":" + port,
Handler: mux,
}

// 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