You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pkg/resourceinterpreter/default/thirdparty/resourcecustomizations/apps.kruise.io/v1beta1/StatefulSet/customizations.yaml
+75-18Lines changed: 75 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -24,24 +24,46 @@ spec:
24
24
statusAggregation:
25
25
luaScript: >
26
26
function AggregateStatus(desiredObj, statusItems)
27
-
if statusItems == nil then
28
-
return desiredObj
29
-
end
30
27
if desiredObj.status == nil then
31
28
desiredObj.status = {}
32
29
end
33
30
if desiredObj.metadata.generation == nil then
34
31
desiredObj.metadata.generation = 0
35
32
end
36
-
generation = desiredObj.metadata.generation
37
-
replicas = 0
38
-
readyReplicas = 0
39
-
currentReplicas = 0
40
-
updatedReplicas = 0
41
-
availableReplicas = 0
42
-
updatedReadyReplicas = 0
43
-
updateRevision = ''
44
-
currentRevision = ''
33
+
if desiredObj.status.observedGeneration == nil then
34
+
desiredObj.status.observedGeneration = 0
35
+
end
36
+
37
+
-- Initialize status fields if status doest not exist
38
+
-- If the StatefulSet is not spread to any cluster, its status also should be aggregated
Copy file name to clipboardExpand all lines: pkg/resourceinterpreter/default/thirdparty/resourcecustomizations/apps.kruise.io/v1beta1/StatefulSet/testdata/desired-statefulset-nginx.yaml
Copy file name to clipboardExpand all lines: pkg/resourceinterpreter/default/thirdparty/resourcecustomizations/apps.kruise.io/v1beta1/StatefulSet/testdata/observed-statefulset-nginx.yaml
Copy file name to clipboardExpand all lines: pkg/resourceinterpreter/default/thirdparty/resourcecustomizations/apps.kruise.io/v1beta1/StatefulSet/testdata/status-file.yaml
0 commit comments