Add gate halt and approve endpoints

This commit is contained in:
stefanprodan
2019-07-24 12:02:44 +03:00
parent dfdcfed26e
commit 919dafa567
6 changed files with 14 additions and 6 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ spec:
spec:
containers:
- name: loadtester
image: weaveworks/flagger-loadtester:0.5.0
image: weaveworks/flagger-loadtester:0.6.0
imagePullPolicy: IfNotPresent
ports:
- name: http
+2 -2
View File
@@ -1,7 +1,7 @@
apiVersion: v1
name: loadtester
version: 0.5.0
appVersion: 0.5.0
version: 0.6.0
appVersion: 0.6.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.
+1 -1
View File
@@ -2,7 +2,7 @@ replicaCount: 1
image:
repository: weaveworks/flagger-loadtester
tag: 0.4.0
tag: 0.6.0
pullPolicy: IfNotPresent
logLevel: info
+1 -1
View File
@@ -10,7 +10,7 @@ import (
"time"
)
var VERSION = "0.5.0"
var VERSION = "0.6.0"
var (
logLevel string
port string
+1 -1
View File
@@ -17,7 +17,7 @@ spec:
spec:
containers:
- name: loadtester
image: weaveworks/flagger-loadtester:0.5.0
image: weaveworks/flagger-loadtester:0.6.0
imagePullPolicy: IfNotPresent
ports:
- name: http
+8
View File
@@ -21,6 +21,14 @@ func ListenAndServe(port string, timeout time.Duration, logger *zap.SugaredLogge
w.WriteHeader(http.StatusOK)
w.Write([]byte("OK"))
})
mux.HandleFunc("/gate/approve", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
w.Write([]byte("OK"))
})
mux.HandleFunc("/gate/halt", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusForbidden)
w.Write([]byte("Forbidden"))
})
mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
body, err := ioutil.ReadAll(r.Body)
if err != nil {