diff --git a/deploy/istio/backend-grey-dep.yaml b/deploy/istio/backend-grey-dep.yaml index cf3c9e7..2fc21a5 100644 --- a/deploy/istio/backend-grey-dep.yaml +++ b/deploy/istio/backend-grey-dep.yaml @@ -22,7 +22,7 @@ spec: spec: containers: - name: podinfod - image: quay.io/stefanprodan/podinfo:0.6.0-rc.1 + image: quay.io/stefanprodan/podinfo:0.6.0-rc.3 command: - ./podinfo - -port=9898 diff --git a/deploy/istio/backend-orange-dep.yaml b/deploy/istio/backend-orange-dep.yaml index bff4a20..2ecad1a 100644 --- a/deploy/istio/backend-orange-dep.yaml +++ b/deploy/istio/backend-orange-dep.yaml @@ -22,7 +22,7 @@ spec: spec: containers: - name: podinfod - image: quay.io/stefanprodan/podinfo:0.6.0-rc.1 + image: quay.io/stefanprodan/podinfo:0.6.0-rc.3 command: - ./podinfo - -port=9898 diff --git a/deploy/istio/backend-virtual-service.yaml b/deploy/istio/backend-virtual-service.yaml index 25bf5dc..0be42ab 100644 --- a/deploy/istio/backend-virtual-service.yaml +++ b/deploy/istio/backend-virtual-service.yaml @@ -10,11 +10,13 @@ spec: # new version # forward 100% of the traffic to orange - match: - - headers: - x-api-version: - regex: "^(v{0,1})0\\.6\\.([0-9]{1,3}).*" +# - headers: +# x-api-version: +# regex: "^(v{0,1})0\\.6\\.([0-9]{1,3}).*" + - sourceLabels: + color: blue route: - - destination: + - destination: host: podinfo-backend subset: orange timeout: 20s diff --git a/deploy/istio/blue-dep.yaml b/deploy/istio/blue-dep.yaml index 2ed42b7..33fca3a 100644 --- a/deploy/istio/blue-dep.yaml +++ b/deploy/istio/blue-dep.yaml @@ -22,7 +22,7 @@ spec: spec: containers: - name: podinfod - image: quay.io/stefanprodan/podinfo:0.6.0-rc.1 + image: quay.io/stefanprodan/podinfo:0.6.0-rc.3 command: - ./podinfo - -port=9898 diff --git a/deploy/istio/store-dep.yaml b/deploy/istio/store-dep.yaml index 92c95bf..dee8c86 100644 --- a/deploy/istio/store-dep.yaml +++ b/deploy/istio/store-dep.yaml @@ -22,7 +22,7 @@ spec: spec: containers: - name: podinfod - image: quay.io/stefanprodan/podinfo:0.6.0-rc.1 + image: quay.io/stefanprodan/podinfo:0.6.0-rc.3 command: - ./podinfo - -port=9898 diff --git a/deploy/istio/store-virtual-service.yaml b/deploy/istio/store-virtual-service.yaml new file mode 100644 index 0000000..278aab0 --- /dev/null +++ b/deploy/istio/store-virtual-service.yaml @@ -0,0 +1,27 @@ +--- +apiVersion: networking.istio.io/v1alpha3 +kind: VirtualService +metadata: + name: podinfo-store +spec: + hosts: + - podinfo-store + http: + - match: + - sourceLabels: + color: orange + route: + - destination: + host: podinfo-store + timeout: 15s + fault: + delay: + percent: 50 + fixedDelay: 500ms + abort: + percent: 50 + httpStatus: 500 + - route: + - destination: + host: podinfo-store + timeout: 15s diff --git a/pkg/server/handlers.go b/pkg/server/handlers.go index 0c12d17..250b27d 100644 --- a/pkg/server/handlers.go +++ b/pkg/server/handlers.go @@ -157,6 +157,10 @@ func (s *Server) backend(w http.ResponseWriter, r *http.Request) { return } defer resp.Body.Close() + if resp.StatusCode >= 500 { + w.WriteHeader(resp.StatusCode) + return + } rbody, err := ioutil.ReadAll(resp.Body) if err != nil { log.Error().Msgf("Reading the backend request body failed: %v", err) diff --git a/pkg/version/version.go b/pkg/version/version.go index 3057b20..bf12ff1 100644 --- a/pkg/version/version.go +++ b/pkg/version/version.go @@ -1,4 +1,4 @@ package version -var VERSION = "0.6.0-rc.1" +var VERSION = "0.6.0-rc.3" var GITCOMMIT = "unknown"