Skip to content

Commit 6d5bc2b

Browse files
authored
feat: add workload status in rollout status (#47)
* feat: add workload status in rollout status * refactor(rollout): make replicas fields optional in status
1 parent 61ceab2 commit 6d5bc2b

7 files changed

+442
-710
lines changed

config/crd/apps/apps.kusionstack.io_collasets.yaml

Lines changed: 33 additions & 101 deletions
Large diffs are not rendered by default.

config/crd/apps/apps.kusionstack.io_poddecorations.yaml

Lines changed: 325 additions & 593 deletions
Large diffs are not rendered by default.

config/crd/rollout/rollout.kusionstack.io_backendroutings.yaml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2409,7 +2409,22 @@ spec:
24092409
conditions:
24102410
description: Conditions is the list of conditions
24112411
items:
2412-
description: "Condition contains details for one aspect of the current state of this API Resource.\n---\nThis struct is intended for direct use as an array at the field path .status.conditions. For example,\n\n\n\ttype FooStatus struct{\n\t // Represents the observations of a foo's current state.\n\t // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\"\n\t // +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t // other fields\n\t}"
2412+
description: |-
2413+
Condition contains details for one aspect of the current state of this API Resource.
2414+
---
2415+
This struct is intended for direct use as an array at the field path .status.conditions. For example,
2416+
type FooStatus struct{
2417+
// Represents the observations of a foo's current state.
2418+
// Known .status.conditions.type are: "Available", "Progressing", and "Degraded"
2419+
// +patchMergeKey=type
2420+
// +patchStrategy=merge
2421+
// +listType=map
2422+
// +listMapKey=type
2423+
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
2424+
2425+
2426+
// other fields
2427+
}
24132428
properties:
24142429
lastTransitionTime:
24152430
description: |-

config/crd/rollout/rollout.kusionstack.io_rolloutruns.yaml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4700,11 +4700,6 @@ spec:
47004700
updatedRevision:
47014701
description: UpdatedRevision is the updated template revision used to generate pods.
47024702
type: string
4703-
required:
4704-
- replicas
4705-
- updatedAvailableReplicas
4706-
- updatedReadyReplicas
4707-
- updatedReplicas
47084703
type: object
47094704
type: array
47104705
webhooks:
@@ -4810,11 +4805,6 @@ spec:
48104805
updatedRevision:
48114806
description: UpdatedRevision is the updated template revision used to generate pods.
48124807
type: string
4813-
required:
4814-
- replicas
4815-
- updatedAvailableReplicas
4816-
- updatedReadyReplicas
4817-
- updatedReplicas
48184808
type: object
48194809
type: array
48204810
webhooks:
@@ -4956,11 +4946,6 @@ spec:
49564946
updatedRevision:
49574947
description: UpdatedRevision is the updated template revision used to generate pods.
49584948
type: string
4959-
required:
4960-
- replicas
4961-
- updatedAvailableReplicas
4962-
- updatedReadyReplicas
4963-
- updatedReplicas
49644949
type: object
49654950
type: array
49664951
type: object

config/crd/rollout/rollout.kusionstack.io_rollouts.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,61 @@ spec:
219219
rolloutID:
220220
description: RolloutID is reference to rolloutRun name.
221221
type: string
222+
workloadStatuses:
223+
description: WorkloadStatuses describes the referenced workloads status
224+
items:
225+
properties:
226+
availableReplicas:
227+
description: AvailableReplicas is the number of service available
228+
pods targeted by workload.
229+
format: int32
230+
type: integer
231+
cluster:
232+
description: Cluster defines which cluster the workload is in.
233+
type: string
234+
generation:
235+
description: Generation is the found in workload metadata.
236+
format: int64
237+
type: integer
238+
name:
239+
description: Name is the workload name
240+
type: string
241+
observedGeneration:
242+
description: ObservedGeneration is the most recent generation
243+
observed for this workload.
244+
format: int64
245+
type: integer
246+
replicas:
247+
description: Replicas is the desired number of pods targeted
248+
by workload
249+
format: int32
250+
type: integer
251+
stableRevision:
252+
description: StableRevision is the old stable revision used
253+
to generate pods.
254+
type: string
255+
updatedAvailableReplicas:
256+
description: UpdatedAvailableReplicas is the number of service
257+
available pods targeted by workload that have the updated
258+
template spec.
259+
format: int32
260+
type: integer
261+
updatedReadyReplicas:
262+
description: UpdatedReadyReplicas is the number of ready pods
263+
targeted by workload that have the updated template spec.
264+
format: int32
265+
type: integer
266+
updatedReplicas:
267+
description: UpdatedReplicas is the number of pods targeted
268+
by workload that have the updated template spec.
269+
format: int32
270+
type: integer
271+
updatedRevision:
272+
description: UpdatedRevision is the updated template revision
273+
used to generate pods.
274+
type: string
275+
type: object
276+
type: array
222277
type: object
223278
type: object
224279
served: true

rollout/v1alpha1/rollout_types.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ type RolloutStatus struct {
123123
LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"`
124124
// RolloutID is reference to rolloutRun name.
125125
RolloutID string `json:"rolloutID,omitempty"`
126+
127+
// WorkloadStatuses describes the referenced workloads status
128+
// +optional
129+
WorkloadStatuses []RolloutWorkloadStatus `json:"workloadStatuses,omitempty"`
126130
}
127131

128132
// RolloutPhase indicates the current rollout phase
@@ -177,15 +181,19 @@ type RolloutBatchStatus struct {
177181

178182
type RolloutReplicasSummary struct {
179183
// Replicas is the desired number of pods targeted by workload
184+
// +optional
180185
Replicas int32 `json:"replicas"`
181186
// AvailableReplicas is the number of service available pods targeted by workload.
182187
// +optional
183188
AvailableReplicas int32 `json:"availableReplicas"`
184189
// UpdatedReplicas is the number of pods targeted by workload that have the updated template spec.
190+
// +optional
185191
UpdatedReplicas int32 `json:"updatedReplicas"`
186192
// UpdatedReadyReplicas is the number of ready pods targeted by workload that have the updated template spec.
193+
// +optional
187194
UpdatedReadyReplicas int32 `json:"updatedReadyReplicas"`
188195
// UpdatedAvailableReplicas is the number of service available pods targeted by workload that have the updated template spec.
196+
// +optional
189197
UpdatedAvailableReplicas int32 `json:"updatedAvailableReplicas"`
190198
}
191199

rollout/v1alpha1/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)