Skip to content

Commit 649d9f1

Browse files
committed
HYPERFLEET-853 - feat: Fix Reconciled message and add Finalized implementation
1 parent 954d4fc commit 649d9f1

7 files changed

Lines changed: 119 additions & 44 deletions

File tree

models/common/model.tsp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,8 @@ model ResourceCondition {
247247
const ExampleAvailableMessage: string = "All adapters reported Available True for the same generation";
248248
const ExampleReadyReason: string = "All adapters reported Ready True for the current generation";
249249
const ExampleReadyMessage: string = "All adapters reported Ready True for the current generation";
250-
const ExampleReconciledReason: string = "All adapters reconciled at the current generation";
251-
const ExampleReconciledMessage: string = "All adapters reconciled at the current generation";
250+
const ExampleReconciledReason: string = "All required adapters reported Available=True or Finalized=True at the current generation";
251+
const ExampleReconciledMessage: string = "All required adapters reported Available=True or Finalized=True at the current generation";
252252
const ExampleAdapter1: string = "adapter1";
253253
const ExampleAdapter2: string = "adapter2";
254254
const ExampleAdapter1AppliedReason: string = "Validation job applied";
@@ -257,6 +257,8 @@ model ResourceCondition {
257257
const ExampleAdapter1HealthMessage: string = "All adapter1 runtime operations completed successfully";
258258
const ExampleAdapter1AvaliableReason: string = "This adapter1 is available";
259259
const ExampleAdapter1AvaliableMessage: string = "This adapter1 is available";
260+
const ExampleAdapter1FinalizedReason: string = "All resources deleted; cleanup confirmed";
261+
const ExampleAdapter1FinalizedMessage: string = "All resources deleted; cleanup confirmed";
260262
const ExampleAdapter2AppliedReason: string = "Validation job applied";
261263
const ExampleAdapter2AppliedMessage: string = "Adapter2 validation job applied successfully";
262264
const ExampleAdapter2HealthReason: string = "All adapter2 operations completed successfully";

models/statuses/example_adapter_status.tsp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ const exampleAdapterStatus: AdapterStatus = (#{
2626
reason: ExampleAdapter1HealthReason,
2727
message: ExampleAdapter1HealthMessage,
2828
last_transition_time: "2021-01-01T10:00:00Z",
29+
},
30+
#{
31+
type: "Finalized",
32+
status: AdapterConditionStatus.True,
33+
reason: ExampleAdapter1FinalizedReason,
34+
message: ExampleAdapter1FinalizedMessage,
35+
last_transition_time: "2021-01-01T10:00:00Z",
2936
}
3037
],
3138
metadata: #{
@@ -70,6 +77,12 @@ const exampleAdapterStatusCreateRequest: AdapterStatusCreateRequest = (#{
7077
status: AdapterConditionStatus.True,
7178
reason: ExampleAdapter1HealthReason,
7279
message: ExampleAdapter1HealthMessage,
80+
},
81+
#{
82+
type: "Finalized",
83+
status: AdapterConditionStatus.True,
84+
reason: ExampleAdapter1FinalizedReason,
85+
message: ExampleAdapter1FinalizedMessage,
7386
}
7487
],
7588
metadata: #{

models/statuses/model.tsp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ enum ResourceConditionStatus {
1111

1212
/**
1313
* Condition in AdapterStatus
14-
* Used for standard Kubernetes condition types: "Available", "Applied", "Health"
14+
* Used for standard Kubernetes condition types: "Available", "Applied", "Health", "Finalized"
1515
* Note: observed_generation is at AdapterStatus level, not per-condition,
1616
* since all conditions in one AdapterStatus share the same observed generation
1717
*/
@@ -74,7 +74,7 @@ model AdapterStatus {
7474
...AdapterStatusBase;
7575
/**
7676
* Kubernetes-style conditions tracking adapter state
77-
* Typically includes: Available, Applied, Health
77+
* Typically includes: Available, Applied, Health, Finalized
7878
*/
7979
conditions: AdapterCondition[];
8080

schemas/core/openapi.yaml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ paths:
181181
last_transition_time: '2021-01-01T10:00:00Z'
182182
- type: Reconciled
183183
status: 'True'
184-
reason: All adapters reconciled at the current generation
185-
message: All adapters reconciled at the current generation
184+
reason: All required adapters reported Available=True or Finalized=True at the current generation
185+
message: All required adapters reported Available=True or Finalized=True at the current generation
186186
observed_generation: 1
187187
created_time: '2021-01-01T10:00:00Z'
188188
last_updated_time: '2021-01-01T10:00:00Z'
@@ -384,8 +384,8 @@ paths:
384384
last_transition_time: '2021-01-01T10:00:00Z'
385385
- type: Reconciled
386386
status: 'True'
387-
reason: All adapters reconciled at the current generation
388-
message: All adapters reconciled at the current generation
387+
reason: All required adapters reported Available=True or Finalized=True at the current generation
388+
message: All required adapters reported Available=True or Finalized=True at the current generation
389389
observed_generation: 1
390390
created_time: '2021-01-01T10:00:00Z'
391391
last_updated_time: '2021-01-01T10:00:00Z'
@@ -718,7 +718,7 @@ components:
718718
$ref: '#/components/schemas/AdapterConditionStatus'
719719
description: |-
720720
Condition in AdapterStatus
721-
Used for standard Kubernetes condition types: "Available", "Applied", "Health"
721+
Used for standard Kubernetes condition types: "Available", "Applied", "Health", "Finalized"
722722
Note: observed_generation is at AdapterStatus level, not per-condition,
723723
since all conditions in one AdapterStatus share the same observed generation
724724
AdapterConditionStatus:
@@ -773,7 +773,7 @@ components:
773773
$ref: '#/components/schemas/AdapterCondition'
774774
description: |-
775775
Kubernetes-style conditions tracking adapter state
776-
Typically includes: Available, Applied, Health
776+
Typically includes: Available, Applied, Health, Finalized
777777
created_time:
778778
type: string
779779
format: date-time
@@ -807,6 +807,11 @@ components:
807807
reason: All adapter1 operations completed successfully
808808
message: All adapter1 runtime operations completed successfully
809809
last_transition_time: '2021-01-01T10:00:00Z'
810+
- type: Finalized
811+
status: 'True'
812+
reason: All resources deleted; cleanup confirmed
813+
message: All resources deleted; cleanup confirmed
814+
last_transition_time: '2021-01-01T10:00:00Z'
810815
metadata:
811816
job_name: validator-job-abc123
812817
job_namespace: hyperfleet-system
@@ -887,6 +892,10 @@ components:
887892
status: 'True'
888893
reason: All adapter1 operations completed successfully
889894
message: All adapter1 runtime operations completed successfully
895+
- type: Finalized
896+
status: 'True'
897+
reason: All resources deleted; cleanup confirmed
898+
message: All resources deleted; cleanup confirmed
890899
metadata:
891900
job_name: validator-job-abc123
892901
job_namespace: hyperfleet-system
@@ -1054,8 +1063,8 @@ components:
10541063
last_transition_time: '2021-01-01T10:00:00Z'
10551064
- type: Reconciled
10561065
status: 'True'
1057-
reason: All adapters reconciled at the current generation
1058-
message: All adapters reconciled at the current generation
1066+
reason: All required adapters reported Available=True or Finalized=True at the current generation
1067+
message: All required adapters reported Available=True or Finalized=True at the current generation
10591068
observed_generation: 1
10601069
created_time: '2021-01-01T10:00:00Z'
10611070
last_updated_time: '2021-01-01T10:00:00Z'
@@ -1353,8 +1362,8 @@ components:
13531362
last_transition_time: '2021-01-01T10:00:00Z'
13541363
- type: Reconciled
13551364
status: 'True'
1356-
reason: All adapters reconciled at the current generation
1357-
message: All adapters reconciled at the current generation
1365+
reason: All required adapters reported Available=True or Finalized=True at the current generation
1366+
message: All required adapters reported Available=True or Finalized=True at the current generation
13581367
observed_generation: 1
13591368
created_time: '2021-01-01T10:00:00Z'
13601369
last_updated_time: '2021-01-01T10:00:00Z'

schemas/core/swagger.yaml

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,13 @@ paths:
164164
- created_time: '2021-01-01T10:00:00Z'
165165
last_transition_time: '2021-01-01T10:00:00Z'
166166
last_updated_time: '2021-01-01T10:00:00Z'
167-
message: All adapters reconciled at the current generation
167+
message: >-
168+
All required adapters reported Available=True or
169+
Finalized=True at the current generation
168170
observed_generation: 1
169-
reason: All adapters reconciled at the current generation
171+
reason: >-
172+
All required adapters reported Available=True or
173+
Finalized=True at the current generation
170174
status: 'True'
171175
type: Reconciled
172176
- created_time: '2021-01-01T10:00:00Z'
@@ -442,9 +446,13 @@ paths:
442446
- created_time: '2021-01-01T10:00:00Z'
443447
last_transition_time: '2021-01-01T10:00:00Z'
444448
last_updated_time: '2021-01-01T10:00:00Z'
445-
message: All adapters reconciled at the current generation
449+
message: >-
450+
All required adapters reported Available=True or
451+
Finalized=True at the current generation
446452
observed_generation: 1
447-
reason: All adapters reconciled at the current generation
453+
reason: >-
454+
All required adapters reported Available=True or
455+
Finalized=True at the current generation
448456
status: 'True'
449457
type: Reconciled
450458
- created_time: '2021-01-01T10:00:00Z'
@@ -835,7 +843,7 @@ definitions:
835843
Condition in AdapterStatus
836844
837845
Used for standard Kubernetes condition types: "Available", "Applied",
838-
"Health"
846+
"Health", "Finalized"
839847
840848
Note: observed_generation is at AdapterStatus level, not per-condition,
841849
@@ -895,6 +903,11 @@ definitions:
895903
reason: All adapter1 operations completed successfully
896904
status: 'True'
897905
type: Health
906+
- last_transition_time: '2021-01-01T10:00:00Z'
907+
message: All resources deleted; cleanup confirmed
908+
reason: All resources deleted; cleanup confirmed
909+
status: 'True'
910+
type: Finalized
898911
created_time: '2021-01-01T10:00:00Z'
899912
data:
900913
validation_results:
@@ -917,7 +930,7 @@ definitions:
917930
conditions:
918931
description: |-
919932
Kubernetes-style conditions tracking adapter state
920-
Typically includes: Available, Applied, Health
933+
Typically includes: Available, Applied, Health, Finalized
921934
items:
922935
$ref: '#/definitions/AdapterCondition'
923936
type: array
@@ -986,6 +999,10 @@ definitions:
986999
reason: All adapter1 operations completed successfully
9871000
status: 'True'
9881001
type: Health
1002+
- message: All resources deleted; cleanup confirmed
1003+
reason: All resources deleted; cleanup confirmed
1004+
status: 'True'
1005+
type: Finalized
9891006
data:
9901007
validation_results:
9911008
failed: 0
@@ -1142,9 +1159,13 @@ definitions:
11421159
- created_time: '2021-01-01T10:00:00Z'
11431160
last_transition_time: '2021-01-01T10:00:00Z'
11441161
last_updated_time: '2021-01-01T10:00:00Z'
1145-
message: All adapters reconciled at the current generation
1162+
message: >-
1163+
All required adapters reported Available=True or Finalized=True at
1164+
the current generation
11461165
observed_generation: 1
1147-
reason: All adapters reconciled at the current generation
1166+
reason: >-
1167+
All required adapters reported Available=True or Finalized=True at
1168+
the current generation
11481169
status: 'True'
11491170
type: Reconciled
11501171
- created_time: '2021-01-01T10:00:00Z'
@@ -1458,9 +1479,13 @@ definitions:
14581479
- created_time: '2021-01-01T10:00:00Z'
14591480
last_transition_time: '2021-01-01T10:00:00Z'
14601481
last_updated_time: '2021-01-01T10:00:00Z'
1461-
message: All adapters reconciled at the current generation
1482+
message: >-
1483+
All required adapters reported Available=True or Finalized=True at
1484+
the current generation
14621485
observed_generation: 1
1463-
reason: All adapters reconciled at the current generation
1486+
reason: >-
1487+
All required adapters reported Available=True or Finalized=True at
1488+
the current generation
14641489
status: 'True'
14651490
type: Reconciled
14661491
- created_time: '2021-01-01T10:00:00Z'

schemas/gcp/openapi.yaml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ paths:
200200
last_transition_time: '2021-01-01T10:00:00Z'
201201
- type: Reconciled
202202
status: 'True'
203-
reason: All adapters reconciled at the current generation
204-
message: All adapters reconciled at the current generation
203+
reason: All required adapters reported Available=True or Finalized=True at the current generation
204+
message: All required adapters reported Available=True or Finalized=True at the current generation
205205
observed_generation: 1
206206
created_time: '2021-01-01T10:00:00Z'
207207
last_updated_time: '2021-01-01T10:00:00Z'
@@ -422,8 +422,8 @@ paths:
422422
last_transition_time: '2021-01-01T10:00:00Z'
423423
- type: Reconciled
424424
status: 'True'
425-
reason: All adapters reconciled at the current generation
426-
message: All adapters reconciled at the current generation
425+
reason: All required adapters reported Available=True or Finalized=True at the current generation
426+
message: All required adapters reported Available=True or Finalized=True at the current generation
427427
observed_generation: 1
428428
created_time: '2021-01-01T10:00:00Z'
429429
last_updated_time: '2021-01-01T10:00:00Z'
@@ -690,7 +690,7 @@ components:
690690
$ref: '#/components/schemas/AdapterConditionStatus'
691691
description: |-
692692
Condition in AdapterStatus
693-
Used for standard Kubernetes condition types: "Available", "Applied", "Health"
693+
Used for standard Kubernetes condition types: "Available", "Applied", "Health", "Finalized"
694694
Note: observed_generation is at AdapterStatus level, not per-condition,
695695
since all conditions in one AdapterStatus share the same observed generation
696696
AdapterConditionStatus:
@@ -745,7 +745,7 @@ components:
745745
$ref: '#/components/schemas/AdapterCondition'
746746
description: |-
747747
Kubernetes-style conditions tracking adapter state
748-
Typically includes: Available, Applied, Health
748+
Typically includes: Available, Applied, Health, Finalized
749749
created_time:
750750
type: string
751751
format: date-time
@@ -779,6 +779,11 @@ components:
779779
reason: All adapter1 operations completed successfully
780780
message: All adapter1 runtime operations completed successfully
781781
last_transition_time: '2021-01-01T10:00:00Z'
782+
- type: Finalized
783+
status: 'True'
784+
reason: All resources deleted; cleanup confirmed
785+
message: All resources deleted; cleanup confirmed
786+
last_transition_time: '2021-01-01T10:00:00Z'
782787
metadata:
783788
job_name: validator-job-abc123
784789
job_namespace: hyperfleet-system
@@ -990,8 +995,8 @@ components:
990995
last_transition_time: '2021-01-01T10:00:00Z'
991996
- type: Reconciled
992997
status: 'True'
993-
reason: All adapters reconciled at the current generation
994-
message: All adapters reconciled at the current generation
998+
reason: All required adapters reported Available=True or Finalized=True at the current generation
999+
message: All required adapters reported Available=True or Finalized=True at the current generation
9951000
observed_generation: 1
9961001
created_time: '2021-01-01T10:00:00Z'
9971002
last_updated_time: '2021-01-01T10:00:00Z'
@@ -1408,8 +1413,8 @@ components:
14081413
last_transition_time: '2021-01-01T10:00:00Z'
14091414
- type: Reconciled
14101415
status: 'True'
1411-
reason: All adapters reconciled at the current generation
1412-
message: All adapters reconciled at the current generation
1416+
reason: All required adapters reported Available=True or Finalized=True at the current generation
1417+
message: All required adapters reported Available=True or Finalized=True at the current generation
14131418
observed_generation: 1
14141419
created_time: '2021-01-01T10:00:00Z'
14151420
last_updated_time: '2021-01-01T10:00:00Z'

0 commit comments

Comments
 (0)