File tree Expand file tree Collapse file tree 7 files changed +38
-8
lines changed Expand file tree Collapse file tree 7 files changed +38
-8
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ DIR=$( pwd)
4
+
5
+ kubectl delete routerule -l app=github
6
+ kubectl apply -f <( istioctl kube-inject -f $DIR /faultinjection.yml)
Original file line number Diff line number Diff line change
1
+ apiVersion : config.istio.io/v1alpha2
2
+ kind : RouteRule
3
+ metadata :
4
+ name : github-abort
5
+ labels :
6
+ app : github
7
+ spec :
8
+ destination :
9
+ name : github
10
+ route :
11
+ - labels :
12
+ app : github
13
+ httpFault :
14
+ abort :
15
+ percent : 100
16
+ httpStatus : 400
17
+ precedence : 1
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
1
3
DIR=$( pwd)
2
4
3
5
kubectl delete routerule -l app=api
4
- kubectl apply -f <( istioctl kube-inject -f $DIR /api/ routerule.yml)
5
- kubectl apply -f <( istioctl kube-inject -f $DIR /api/ routerule2.yml)
6
+ kubectl apply -f <( istioctl kube-inject -f $DIR /routerule.yml)
7
+ kubectl apply -f <( istioctl kube-inject -f $DIR /routerule2.yml)
Original file line number Diff line number Diff line change 11
11
ports :
12
12
- protocol : TCP
13
13
port : 5000
14
- name : http
14
+ name : http
Original file line number Diff line number Diff line change 11
11
ports :
12
12
- protocol : TCP
13
13
port : 5000
14
+ name : http
Original file line number Diff line number Diff line change 11
11
ports :
12
12
- protocol : TCP
13
13
port : 80
14
- name : http
14
+ name : http
Original file line number Diff line number Diff line change @@ -19,10 +19,14 @@ class App extends Component {
19
19
headers
20
20
} )
21
21
. then ( ( response ) => {
22
- response . json ( ) . then ( json => {
23
- console . log ( json )
24
- this . setState ( { error : false , data : json } )
25
- } )
22
+ if ( response . ok ) {
23
+ response . json ( ) . then ( json => {
24
+ console . log ( json )
25
+ this . setState ( { error : false , data : json } )
26
+ } )
27
+ } else {
28
+ throw new Error ( 'Network response was not ok.' )
29
+ }
26
30
} )
27
31
. catch ( ( err ) => this . setState ( { error : true , data : err . toString ( ) } ) )
28
32
}
You can’t perform that action at this time.
0 commit comments