Skip to content

Commit f1d49ae

Browse files
committed
Повышаем надёжность reconcile и снижаем лишние срабатывания при обновлении
оператора. - Возвращаем RequeueAfter, пока Deployment процессора не в стабильном Ready-состоянии, чтобы статус не зависел только от watch-событий. - Ограничиваем enqueue всех DataFlow срабатываниями по существенным изменениям Deployment оператора (generation / spec.template), а не по каждому обновлению status. - Логируем ошибку List при построении очереди reconcile, чтобы обновления образа оператора не приводили к «тихому» пропуску переката процессоров. Tests: обновить/добавить тесты на предикат и поведение Reconcile при Pending.
1 parent eee1142 commit f1d49ae

6 files changed

Lines changed: 573 additions & 5 deletions

File tree

api/v1/dataflow_types.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -918,6 +918,14 @@ type DataFlowStatus struct {
918918
// ErrorCount is the number of errors encountered
919919
// +optional
920920
ErrorCount int64 `json:"errorCount,omitempty"`
921+
922+
// Conditions represent the latest available observations of the DataFlow state.
923+
// +optional
924+
// +patchMergeKey=type
925+
// +patchStrategy=merge
926+
// +listType=map
927+
// +listMapKey=type
928+
Conditions []metav1.Condition `json:"conditions,omitempty"`
921929
}
922930

923931
//+kubebuilder:object:root=true

api/v1/zz_generated.deepcopy.go

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

config/crd/bases/dataflow.dataflow.io_dataflows.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,6 +1180,67 @@ spec:
11801180
status:
11811181
description: DataFlowStatus defines the observed state of DataFlow
11821182
properties:
1183+
conditions:
1184+
description: Conditions represent the latest available observations
1185+
of the DataFlow state.
1186+
items:
1187+
description: Condition contains details for one aspect of the current
1188+
state of this API Resource.
1189+
properties:
1190+
lastTransitionTime:
1191+
description: |-
1192+
lastTransitionTime is the last time the condition transitioned from one status to another.
1193+
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
1194+
format: date-time
1195+
type: string
1196+
message:
1197+
description: |-
1198+
message is a human readable message indicating details about the transition.
1199+
This may be an empty string.
1200+
maxLength: 32768
1201+
type: string
1202+
observedGeneration:
1203+
description: |-
1204+
observedGeneration represents the .metadata.generation that the condition was set based upon.
1205+
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
1206+
with respect to the current state of the instance.
1207+
format: int64
1208+
minimum: 0
1209+
type: integer
1210+
reason:
1211+
description: |-
1212+
reason contains a programmatic identifier indicating the reason for the condition's last transition.
1213+
Producers of specific condition types may define expected values and meanings for this field,
1214+
and whether the values are considered a guaranteed API.
1215+
The value should be a CamelCase string.
1216+
This field may not be empty.
1217+
maxLength: 1024
1218+
minLength: 1
1219+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
1220+
type: string
1221+
status:
1222+
description: status of the condition, one of True, False, Unknown.
1223+
enum:
1224+
- "True"
1225+
- "False"
1226+
- Unknown
1227+
type: string
1228+
type:
1229+
description: type of condition in CamelCase or in foo.example.com/CamelCase.
1230+
maxLength: 316
1231+
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
1232+
type: string
1233+
required:
1234+
- lastTransitionTime
1235+
- message
1236+
- reason
1237+
- status
1238+
- type
1239+
type: object
1240+
type: array
1241+
x-kubernetes-list-map-keys:
1242+
- type
1243+
x-kubernetes-list-type: map
11831244
errorCount:
11841245
description: ErrorCount is the number of errors encountered
11851246
format: int64

0 commit comments

Comments
 (0)