Commit 4722a7f authored Oct 9, 2024 · 24 / 26 · Verified
1 parent 19d85aa commit 4722a7f Copy full SHA for 4722a7f
File tree 8 files changed +284
-1
lines changed
resource_customizations/numaplane.numaproj.io/PipelineRollout/actions
8 files changed +284
-1
lines changed Original file line number Diff line number Diff line change @@ -4,4 +4,10 @@ actionTests:
4
4
expectedOutputPath : testdata/rollout-paused.yaml
5
5
- action : unpause
6
6
inputPath : testdata/rollout-paused.yaml
7
- expectedOutputPath : testdata/rollout-running.yaml
7
+ expectedOutputPath : testdata/rollout-running.yaml
8
+ - action : allow-data-loss
9
+ inputPath : testdata/rollout-in-ppnd.yaml
10
+ expectedOutputPath : testdata/rollout-allowing-data-loss.yaml
11
+ - action : disallow-data-loss
12
+ inputPath : testdata/rollout-allowing-data-loss.yaml
13
+ expectedOutputPath : testdata/rollout-disallowing-data-loss.yaml
Original file line number Diff line number Diff line change
1
+ if obj .metadata .annotations == nil then
2
+ obj .metadata .annotations = {}
3
+ end
4
+ obj .metadata .annotations [" numaplane.numaproj.io/allow-data-loss" ] = " true"
5
+ return obj
Original file line number Diff line number Diff line change
1
+ if obj .metadata .annotations == nil then
2
+ obj .metadata .annotations = {}
3
+ end
4
+ obj .metadata .annotations [" numaplane.numaproj.io/allow-data-loss" ] = " false"
5
+ return obj
Original file line number Diff line number Diff line change 1
1
local actions = {}
2
2
actions [" pause" ] = {[" disabled" ] = true }
3
3
actions [" unpause" ] = {[" disabled" ] = true }
4
+ actions [" allow-data-loss" ] = {[" disabled" ] = true }
5
+ actions [" disallow-data-loss" ] = {[" disabled" ] = true }
4
6
7
+ -- pause/unpause
5
8
local paused = false
6
9
if obj .spec .pipeline .spec .lifecycle ~= nil and obj .spec .pipeline .spec .lifecycle .desiredPhase ~= nil and obj .spec .pipeline .spec .lifecycle .desiredPhase == " Paused" then
7
10
paused = true
@@ -11,4 +14,13 @@ if paused then
11
14
else
12
15
actions [" pause" ][" disabled" ] = false
13
16
end
17
+
18
+ -- allow-data-loss/disallow-data-loss
19
+ if obj .status ~= nil and obj .status .upgradeInProgress == " PipelinePauseAndDrain" then
20
+ actions [" allow-data-loss" ][" disabled" ] = false
21
+ end
22
+ if obj .metadata .annotations ~= nil and obj .metadata .annotations [" numaplane.numaproj.io/allow-data-loss" ] == " true" then
23
+ actions [" disallow-data-loss" ][" disabled" ] = false
24
+ end
25
+
14
26
return actions
Original file line number Diff line number Diff line change
1
+ apiVersion : numaplane.numaproj.io/v1alpha1
2
+ kind : PipelineRollout
3
+ metadata :
4
+ creationTimestamp : " 2024-10-02T23:01:46Z"
5
+ annotations :
6
+ numaplane.numaproj.io/allow-data-loss : " true"
7
+ finalizers :
8
+ - numaplane.numaproj.io/numaplane-controller
9
+ generation : 2
10
+ name : test-pipeline-rollout
11
+ namespace : numaplane-system
12
+ resourceVersion : " 1771"
13
+ uid : f89f2135-a6a6-443c-8584-cbf6d789f2db
14
+ spec :
15
+ pipeline :
16
+ spec :
17
+ edges :
18
+ - conditions : null
19
+ from : in
20
+ to : cat
21
+ - conditions : null
22
+ from : cat
23
+ to : out
24
+ interStepBufferServiceName : test-isbservice-rollout
25
+ lifecycle : {}
26
+ vertices :
27
+ - name : in
28
+ scale :
29
+ max : 1
30
+ min : 1
31
+ zeroReplicaSleepSeconds : 15
32
+ source :
33
+ generator :
34
+ duration : 1s
35
+ rpu : 5
36
+ updateStrategy : {}
37
+ - name : cat
38
+ scale :
39
+ max : 1
40
+ min : 1
41
+ zeroReplicaSleepSeconds : 15
42
+ udf :
43
+ builtin :
44
+ name : cat
45
+ container : null
46
+ groupBy : null
47
+ updateStrategy : {}
48
+ - name : out
49
+ scale :
50
+ max : 1
51
+ min : 1
52
+ zeroReplicaSleepSeconds : 15
53
+ sink :
54
+ log : {}
55
+ retryStrategy : {}
56
+ updateStrategy : {}
57
+ watermark : {}
58
+ status :
59
+ conditions :
60
+ - lastTransitionTime : " 2024-10-02T23:01:46Z"
61
+ message : Successful
62
+ observedGeneration : 1
63
+ reason : Successful
64
+ status : " True"
65
+ type : ChildResourceDeployed
66
+ - lastTransitionTime : " 2024-10-02T23:02:41Z"
67
+ message : Pipeline Progressing
68
+ observedGeneration : 2
69
+ reason : Progressing
70
+ status : " False"
71
+ type : ChildResourcesHealthy
72
+ - lastTransitionTime : " 2024-10-02T23:02:41Z"
73
+ message : Pipeline pausing
74
+ observedGeneration : 2
75
+ reason : PipelinePausing
76
+ status : " True"
77
+ type : PipelinePausingOrPaused
78
+ message : Progressing
79
+ nameCount : 0
80
+ observedGeneration : 2
81
+ pauseStatus :
82
+ lastPauseBeginTime : " 2024-10-02T23:02:41Z"
83
+ lastPauseEndTime : null
84
+ phase : Pending
85
+ upgradeInProgress : PipelinePauseAndDrain
Original file line number Diff line number Diff line change
1
+ apiVersion : numaplane.numaproj.io/v1alpha1
2
+ kind : PipelineRollout
3
+ metadata :
4
+ creationTimestamp : " 2024-10-02T23:01:46Z"
5
+ annotations :
6
+ numaplane.numaproj.io/allow-data-loss : " false"
7
+ finalizers :
8
+ - numaplane.numaproj.io/numaplane-controller
9
+ generation : 2
10
+ name : test-pipeline-rollout
11
+ namespace : numaplane-system
12
+ resourceVersion : " 1771"
13
+ uid : f89f2135-a6a6-443c-8584-cbf6d789f2db
14
+ spec :
15
+ pipeline :
16
+ spec :
17
+ edges :
18
+ - conditions : null
19
+ from : in
20
+ to : cat
21
+ - conditions : null
22
+ from : cat
23
+ to : out
24
+ interStepBufferServiceName : test-isbservice-rollout
25
+ lifecycle : {}
26
+ vertices :
27
+ - name : in
28
+ scale :
29
+ max : 1
30
+ min : 1
31
+ zeroReplicaSleepSeconds : 15
32
+ source :
33
+ generator :
34
+ duration : 1s
35
+ rpu : 5
36
+ updateStrategy : {}
37
+ - name : cat
38
+ scale :
39
+ max : 1
40
+ min : 1
41
+ zeroReplicaSleepSeconds : 15
42
+ udf :
43
+ builtin :
44
+ name : cat
45
+ container : null
46
+ groupBy : null
47
+ updateStrategy : {}
48
+ - name : out
49
+ scale :
50
+ max : 1
51
+ min : 1
52
+ zeroReplicaSleepSeconds : 15
53
+ sink :
54
+ log : {}
55
+ retryStrategy : {}
56
+ updateStrategy : {}
57
+ watermark : {}
58
+ status :
59
+ conditions :
60
+ - lastTransitionTime : " 2024-10-02T23:01:46Z"
61
+ message : Successful
62
+ observedGeneration : 1
63
+ reason : Successful
64
+ status : " True"
65
+ type : ChildResourceDeployed
66
+ - lastTransitionTime : " 2024-10-02T23:02:41Z"
67
+ message : Pipeline Progressing
68
+ observedGeneration : 2
69
+ reason : Progressing
70
+ status : " False"
71
+ type : ChildResourcesHealthy
72
+ - lastTransitionTime : " 2024-10-02T23:02:41Z"
73
+ message : Pipeline pausing
74
+ observedGeneration : 2
75
+ reason : PipelinePausing
76
+ status : " True"
77
+ type : PipelinePausingOrPaused
78
+ message : Progressing
79
+ nameCount : 0
80
+ observedGeneration : 2
81
+ pauseStatus :
82
+ lastPauseBeginTime : " 2024-10-02T23:02:41Z"
83
+ lastPauseEndTime : null
84
+ phase : Pending
85
+ upgradeInProgress : PipelinePauseAndDrain
Original file line number Diff line number Diff line change
1
+ apiVersion : numaplane.numaproj.io/v1alpha1
2
+ kind : PipelineRollout
3
+ metadata :
4
+ creationTimestamp : " 2024-10-02T23:01:46Z"
5
+ finalizers :
6
+ - numaplane.numaproj.io/numaplane-controller
7
+ generation : 2
8
+ name : test-pipeline-rollout
9
+ namespace : numaplane-system
10
+ resourceVersion : " 1771"
11
+ uid : f89f2135-a6a6-443c-8584-cbf6d789f2db
12
+ spec :
13
+ pipeline :
14
+ spec :
15
+ edges :
16
+ - conditions : null
17
+ from : in
18
+ to : cat
19
+ - conditions : null
20
+ from : cat
21
+ to : out
22
+ interStepBufferServiceName : test-isbservice-rollout
23
+ lifecycle : {}
24
+ vertices :
25
+ - name : in
26
+ scale :
27
+ max : 1
28
+ min : 1
29
+ zeroReplicaSleepSeconds : 15
30
+ source :
31
+ generator :
32
+ duration : 1s
33
+ rpu : 5
34
+ updateStrategy : {}
35
+ - name : cat
36
+ scale :
37
+ max : 1
38
+ min : 1
39
+ zeroReplicaSleepSeconds : 15
40
+ udf :
41
+ builtin :
42
+ name : cat
43
+ container : null
44
+ groupBy : null
45
+ updateStrategy : {}
46
+ - name : out
47
+ scale :
48
+ max : 1
49
+ min : 1
50
+ zeroReplicaSleepSeconds : 15
51
+ sink :
52
+ log : {}
53
+ retryStrategy : {}
54
+ updateStrategy : {}
55
+ watermark : {}
56
+ status :
57
+ conditions :
58
+ - lastTransitionTime : " 2024-10-02T23:01:46Z"
59
+ message : Successful
60
+ observedGeneration : 1
61
+ reason : Successful
62
+ status : " True"
63
+ type : ChildResourceDeployed
64
+ - lastTransitionTime : " 2024-10-02T23:02:41Z"
65
+ message : Pipeline Progressing
66
+ observedGeneration : 2
67
+ reason : Progressing
68
+ status : " False"
69
+ type : ChildResourcesHealthy
70
+ - lastTransitionTime : " 2024-10-02T23:02:41Z"
71
+ message : Pipeline pausing
72
+ observedGeneration : 2
73
+ reason : PipelinePausing
74
+ status : " True"
75
+ type : PipelinePausingOrPaused
76
+ message : Progressing
77
+ nameCount : 0
78
+ observedGeneration : 2
79
+ pauseStatus :
80
+ lastPauseBeginTime : " 2024-10-02T23:02:41Z"
81
+ lastPauseEndTime : null
82
+ phase : Pending
83
+ upgradeInProgress : PipelinePauseAndDrain
You can’t perform that action at this time.
0 commit comments