File tree Expand file tree Collapse file tree 3 files changed +123
-0
lines changed Expand file tree Collapse file tree 3 files changed +123
-0
lines changed Original file line number Diff line number Diff line change
1
+ apiVersion : v1
2
+ kind : Service
3
+ metadata :
4
+ name : istio-host-split-canary
5
+ spec :
6
+ ports :
7
+ - port : 80
8
+ targetPort : http
9
+ protocol : TCP
10
+ name : http
11
+ selector :
12
+ app : istio-host-split
13
+
14
+ ---
15
+ apiVersion : v1
16
+ kind : Service
17
+ metadata :
18
+ name : istio-host-split-stable
19
+ spec :
20
+ ports :
21
+ - port : 80
22
+ targetPort : http
23
+ protocol : TCP
24
+ name : http
25
+ selector :
26
+ app : istio-host-split
27
+
28
+ ---
29
+ apiVersion : networking.istio.io/v1alpha3
30
+ kind : VirtualService
31
+ metadata :
32
+ name : istio-host-split-vsvc
33
+ spec :
34
+ hosts :
35
+ - istio-host-split
36
+ http :
37
+ - name : primary
38
+ route :
39
+ - destination :
40
+ host : istio-host-split-stable
41
+ weight : 100
42
+ - destination :
43
+ host : istio-host-split-canary
44
+ weight : 0
45
+
46
+ ---
47
+ apiVersion : argoproj.io/v1alpha1
48
+ kind : Rollout
49
+ metadata :
50
+ name : istio-host-split
51
+ spec :
52
+ replicas : 5
53
+ strategy :
54
+ canary :
55
+ canaryService : istio-host-split-canary
56
+ stableService : istio-host-split-stable
57
+ trafficRouting :
58
+ istio :
59
+ virtualService :
60
+ name : istio-host-split-vsvc
61
+ routes :
62
+ - primary
63
+ steps :
64
+ - setCanaryScale :
65
+ replicas : 2
66
+ - setWeight : 20
67
+ - pause : {}
68
+ - setCanaryScale :
69
+ replicas : 4
70
+ - setWeight : 40
71
+ - pause : {}
72
+ selector :
73
+ matchLabels :
74
+ app : istio-host-split
75
+ template :
76
+ metadata :
77
+ labels :
78
+ app : istio-host-split
79
+ spec :
80
+ containers :
81
+ - name : istio-host-split
82
+ image : nginx:1.19-alpine
83
+ ports :
84
+ - name : http
85
+ containerPort : 80
86
+ protocol : TCP
87
+ resources :
88
+ requests :
89
+ memory : 16Mi
90
+ cpu : 5m
Original file line number Diff line number Diff line change @@ -197,3 +197,32 @@ func (s *IstioSuite) TestIstioSubsetSplitSingleRoute() {
197
197
}).
198
198
ExpectRevisionPodCount ("1" , 1 ) // don't scale down old replicaset since it will be within scaleDownDelay
199
199
}
200
+
201
+ func (s * IstioSuite ) TestIstioAbortUpdateDeleteAllCanaryPods () {
202
+ s .Given ().
203
+ RolloutObjects ("@istio/istio-rollout-abort-delete-all-canary-pods.yaml" ).
204
+ When ().
205
+ ApplyManifests ().
206
+ WaitForRolloutStatus ("Healthy" ).
207
+ Then ().
208
+ When ().
209
+ UpdateSpec ().
210
+ WaitForRolloutStatus ("Paused" ).
211
+ Then ().
212
+ ExpectRevisionPodCount ("2" , 2 ).
213
+ When ().
214
+ PromoteRollout ().
215
+ WaitForRolloutStatus ("Paused" ).
216
+ Then ().
217
+ When ().
218
+ PromoteRollout ().
219
+ WaitForRolloutStatus ("Paused" ).
220
+ Then ().
221
+ ExpectRevisionPodCount ("2" , 4 ).
222
+ When ().
223
+ AbortRollout ().
224
+ WaitForRolloutStatus ("Degraded" ).
225
+ Then ().
226
+ ExpectRevisionPodCount ("2" , 0 ).
227
+ ExpectRevisionPodCount ("1" , 5 )
228
+ }
Original file line number Diff line number Diff line change @@ -331,6 +331,10 @@ func GetCurrentSetWeight(rollout *v1alpha1.Rollout) int32 {
331
331
// TrafficRouting is required to be set for SetCanaryScale to be applicable.
332
332
// If MatchTrafficWeight is set after a previous SetCanaryScale step, it will likewise be ignored.
333
333
func UseSetCanaryScale (rollout * v1alpha1.Rollout ) * v1alpha1.SetCanaryScale {
334
+ // Return nil when rollout is aborted
335
+ if rollout .Status .Abort {
336
+ return nil
337
+ }
334
338
currentStep , currentStepIndex := GetCurrentCanaryStep (rollout )
335
339
if currentStep == nil {
336
340
return nil
You can’t perform that action at this time.
0 commit comments