Skip to content

Commit 31fbfe1

Browse files
Merge pull request #34 from tirthct/hyperfleet-853
HYPERFLEET-853 - feat: Add Reconciled to OpenAPI spec
2 parents fe59c7a + 5194114 commit 31fbfe1

16 files changed

Lines changed: 389 additions & 91 deletions

File tree

main.tsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ using OpenAPI;
2020
*
2121
*/
2222
@service(#{ title: "HyperFleet API" })
23-
@info(#{ version: "1.0.7", contact: #{ name: "HyperFleet Team" }, license: #{ name: "Apache 2.0" ,url: "https://www.apache.org/licenses/LICENSE-2.0"} })
23+
@info(#{ version: "1.0.8", contact: #{ name: "HyperFleet Team" }, license: #{ name: "Apache 2.0" ,url: "https://www.apache.org/licenses/LICENSE-2.0"} })
2424
@server("https://hyperfleet.redhat.com", "Production")
2525
@route("/api/hyperfleet/v1")
2626
namespace HyperFleet;

models-core/cluster/example_cluster.tsp

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ const exampleCluster: Cluster = #{
2222
last_updated_time: "2021-01-01T10:00:00Z",
2323
last_transition_time: "2021-01-01T10:00:00Z",
2424
},
25+
#{
26+
type: ConditionType.Reconciled,
27+
status: ResourceConditionStatus.True,
28+
reason: ExampleReconciledReason,
29+
message: ExampleReconciledMessage,
30+
observed_generation: 1,
31+
created_time: "2021-01-01T10:00:00Z",
32+
last_updated_time: "2021-01-01T10:00:00Z",
33+
last_transition_time: "2021-01-01T10:00:00Z",
34+
},
2535
#{
2636
type: ConditionType.Available,
2737
status: ResourceConditionStatus.True,
@@ -75,7 +85,17 @@ const exampleDeletedCluster: Cluster = #{
7585
status: ResourceConditionStatus.True,
7686
reason: ExampleReadyReason,
7787
message: ExampleReadyMessage,
78-
observed_generation: 1,
88+
observed_generation: 2,
89+
created_time: "2021-01-01T10:00:00Z",
90+
last_updated_time: "2021-01-01T10:00:00Z",
91+
last_transition_time: "2021-01-01T10:00:00Z",
92+
},
93+
#{
94+
type: ConditionType.Reconciled,
95+
status: ResourceConditionStatus.True,
96+
reason: ExampleReconciledReason,
97+
message: ExampleReconciledMessage,
98+
observed_generation: 2,
7999
created_time: "2021-01-01T10:00:00Z",
80100
last_updated_time: "2021-01-01T10:00:00Z",
81101
last_transition_time: "2021-01-01T10:00:00Z",
@@ -85,7 +105,7 @@ const exampleDeletedCluster: Cluster = #{
85105
status: ResourceConditionStatus.True,
86106
reason: ExampleAvailableReason,
87107
message: ExampleAvailableMessage,
88-
observed_generation: 1,
108+
observed_generation: 2,
89109
created_time: "2021-01-01T10:00:00Z",
90110
last_updated_time: "2021-01-01T10:00:00Z",
91111
last_transition_time: "2021-01-01T10:00:00Z",
@@ -95,7 +115,7 @@ const exampleDeletedCluster: Cluster = #{
95115
status: ResourceConditionStatus.True,
96116
reason: ExampleAdapter1AvaliableReason,
97117
message: ExampleAdapter1AvaliableMessage,
98-
observed_generation: 1,
118+
observed_generation: 2,
99119
created_time: "2021-01-01T10:00:00Z",
100120
last_updated_time: "2021-01-01T10:00:00Z",
101121
last_transition_time: "2021-01-01T10:00:00Z",
@@ -105,7 +125,7 @@ const exampleDeletedCluster: Cluster = #{
105125
status: ResourceConditionStatus.True,
106126
reason: ExampleAdapter2AvaliableReason,
107127
message: ExampleAdapter2AvaliableMessage,
108-
observed_generation: 1,
128+
observed_generation: 2,
109129
created_time: "2021-01-01T10:01:00Z",
110130
last_updated_time: "2021-01-01T10:01:00Z",
111131
last_transition_time: "2021-01-01T10:01:00Z",

models-core/nodepool/example_nodepool.tsp

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@ const exampleNodePool: NodePool = #{
2727
last_updated_time: "2021-01-01T10:00:00Z",
2828
last_transition_time: "2021-01-01T10:00:00Z",
2929
},
30+
#{
31+
type: ConditionType.Reconciled,
32+
status: ResourceConditionStatus.True,
33+
reason: ExampleReconciledReason,
34+
message: ExampleReconciledMessage,
35+
observed_generation: 1,
36+
created_time: "2021-01-01T10:00:00Z",
37+
last_updated_time: "2021-01-01T10:00:00Z",
38+
last_transition_time: "2021-01-01T10:00:00Z",
39+
},
3040
#{
3141
type: ConditionType.Available,
3242
status: ResourceConditionStatus.True,
@@ -85,7 +95,17 @@ const exampleDeletedNodePool: NodePool = #{
8595
status: ResourceConditionStatus.True,
8696
reason: ExampleReadyReason,
8797
message: ExampleReadyMessage,
88-
observed_generation: 1,
98+
observed_generation: 2,
99+
created_time: "2021-01-01T10:00:00Z",
100+
last_updated_time: "2021-01-01T10:00:00Z",
101+
last_transition_time: "2021-01-01T10:00:00Z",
102+
},
103+
#{
104+
type: ConditionType.Reconciled,
105+
status: ResourceConditionStatus.True,
106+
reason: ExampleReconciledReason,
107+
message: ExampleReconciledMessage,
108+
observed_generation: 2,
89109
created_time: "2021-01-01T10:00:00Z",
90110
last_updated_time: "2021-01-01T10:00:00Z",
91111
last_transition_time: "2021-01-01T10:00:00Z",
@@ -95,7 +115,7 @@ const exampleDeletedNodePool: NodePool = #{
95115
status: ResourceConditionStatus.True,
96116
reason: ExampleAvailableReason,
97117
message: ExampleAvailableMessage,
98-
observed_generation: 1,
118+
observed_generation: 2,
99119
created_time: "2021-01-01T10:00:00Z",
100120
last_updated_time: "2021-01-01T10:00:00Z",
101121
last_transition_time: "2021-01-01T10:00:00Z",
@@ -105,7 +125,7 @@ const exampleDeletedNodePool: NodePool = #{
105125
status: ResourceConditionStatus.True,
106126
reason: ExampleAdapter1AvaliableReason,
107127
message: ExampleAdapter1AvaliableMessage,
108-
observed_generation: 1,
128+
observed_generation: 2,
109129
created_time: "2021-01-01T10:00:00Z",
110130
last_updated_time: "2021-01-01T10:00:00Z",
111131
last_transition_time: "2021-01-01T10:00:00Z",
@@ -115,7 +135,7 @@ const exampleDeletedNodePool: NodePool = #{
115135
status: ResourceConditionStatus.True,
116136
reason: ExampleAdapter2AvaliableReason,
117137
message: ExampleAdapter2AvaliableMessage,
118-
observed_generation: 1,
138+
observed_generation: 2,
119139
created_time: "2021-01-01T10:01:00Z",
120140
last_updated_time: "2021-01-01T10:01:00Z",
121141
last_transition_time: "2021-01-01T10:01:00Z",

models-gcp/cluster/example_cluster.tsp

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@ const exampleCluster: Cluster = #{
4444
last_updated_time: "2021-01-01T10:00:00Z",
4545
last_transition_time: "2021-01-01T10:00:00Z",
4646
},
47+
#{
48+
type: ConditionType.Reconciled,
49+
status: ResourceConditionStatus.True,
50+
reason: ExampleReconciledReason,
51+
message: ExampleReconciledMessage,
52+
observed_generation: 1,
53+
created_time: "2021-01-01T10:00:00Z",
54+
last_updated_time: "2021-01-01T10:00:00Z",
55+
last_transition_time: "2021-01-01T10:00:00Z",
56+
},
4757
#{
4858
type: ConditionType.Available,
4959
status: ResourceConditionStatus.True,
@@ -119,7 +129,17 @@ const exampleDeletedCluster: Cluster = #{
119129
status: ResourceConditionStatus.True,
120130
reason: ExampleReadyReason,
121131
message: ExampleReadyMessage,
122-
observed_generation: 1,
132+
observed_generation: 2,
133+
created_time: "2021-01-01T10:00:00Z",
134+
last_updated_time: "2021-01-01T10:00:00Z",
135+
last_transition_time: "2021-01-01T10:00:00Z",
136+
},
137+
#{
138+
type: ConditionType.Reconciled,
139+
status: ResourceConditionStatus.True,
140+
reason: ExampleReconciledReason,
141+
message: ExampleReconciledMessage,
142+
observed_generation: 2,
123143
created_time: "2021-01-01T10:00:00Z",
124144
last_updated_time: "2021-01-01T10:00:00Z",
125145
last_transition_time: "2021-01-01T10:00:00Z",
@@ -129,7 +149,7 @@ const exampleDeletedCluster: Cluster = #{
129149
status: ResourceConditionStatus.True,
130150
reason: ExampleAvailableReason,
131151
message: ExampleAvailableMessage,
132-
observed_generation: 1,
152+
observed_generation: 2,
133153
created_time: "2021-01-01T10:00:00Z",
134154
last_updated_time: "2021-01-01T10:00:00Z",
135155
last_transition_time: "2021-01-01T10:00:00Z",
@@ -139,7 +159,7 @@ const exampleDeletedCluster: Cluster = #{
139159
status: ResourceConditionStatus.True,
140160
reason: ExampleAdapter1AvaliableReason,
141161
message: ExampleAdapter1AvaliableMessage,
142-
observed_generation: 1,
162+
observed_generation: 2,
143163
created_time: "2021-01-01T10:00:00Z",
144164
last_updated_time: "2021-01-01T10:00:00Z",
145165
last_transition_time: "2021-01-01T10:00:00Z",
@@ -149,7 +169,7 @@ const exampleDeletedCluster: Cluster = #{
149169
status: ResourceConditionStatus.True,
150170
reason: ExampleAdapter2AvaliableReason,
151171
message: ExampleAdapter2AvaliableMessage,
152-
observed_generation: 1,
172+
observed_generation: 2,
153173
created_time: "2021-01-01T10:01:00Z",
154174
last_updated_time: "2021-01-01T10:01:00Z",
155175
last_transition_time: "2021-01-01T10:01:00Z",

models-gcp/nodepool/example_nodepool.tsp

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,16 @@ const exampleNodePool: NodePool = #{
4848
last_updated_time: "2021-01-01T10:00:00Z",
4949
last_transition_time: "2021-01-01T10:00:00Z",
5050
},
51+
#{
52+
type: ConditionType.Reconciled,
53+
status: ResourceConditionStatus.True,
54+
reason: ExampleReconciledReason,
55+
message: ExampleReconciledMessage,
56+
observed_generation: 1,
57+
created_time: "2021-01-01T10:00:00Z",
58+
last_updated_time: "2021-01-01T10:00:00Z",
59+
last_transition_time: "2021-01-01T10:00:00Z",
60+
},
5161
#{
5262
type: ConditionType.Available,
5363
status: ResourceConditionStatus.True,
@@ -128,7 +138,17 @@ const exampleDeletedNodePool: NodePool = #{
128138
status: ResourceConditionStatus.True,
129139
reason: "ResourceReady",
130140
message: "All conditions successful for current spec generation",
131-
observed_generation: 1,
141+
observed_generation: 2,
142+
created_time: "2021-01-01T10:00:00Z",
143+
last_updated_time: "2021-01-01T10:00:00Z",
144+
last_transition_time: "2021-01-01T10:00:00Z",
145+
},
146+
#{
147+
type: ConditionType.Reconciled,
148+
status: ResourceConditionStatus.True,
149+
reason: ExampleReconciledReason,
150+
message: ExampleReconciledMessage,
151+
observed_generation: 2,
132152
created_time: "2021-01-01T10:00:00Z",
133153
last_updated_time: "2021-01-01T10:00:00Z",
134154
last_transition_time: "2021-01-01T10:00:00Z",
@@ -138,7 +158,7 @@ const exampleDeletedNodePool: NodePool = #{
138158
status: ResourceConditionStatus.True,
139159
reason: "ResourceAvailable",
140160
message: "All conditions successful for observed_generation",
141-
observed_generation: 1,
161+
observed_generation: 2,
142162
created_time: "2021-01-01T10:00:00Z",
143163
last_updated_time: "2021-01-01T10:00:00Z",
144164
last_transition_time: "2021-01-01T10:00:00Z",
@@ -148,7 +168,7 @@ const exampleDeletedNodePool: NodePool = #{
148168
status: ResourceConditionStatus.True,
149169
reason: "All validations passed",
150170
message: "NodePool validation passed",
151-
observed_generation: 1,
171+
observed_generation: 2,
152172
created_time: "2021-01-01T10:00:00Z",
153173
last_updated_time: "2021-01-01T10:00:00Z",
154174
last_transition_time: "2021-01-01T10:00:00Z",
@@ -158,7 +178,7 @@ const exampleDeletedNodePool: NodePool = #{
158178
status: ResourceConditionStatus.True,
159179
reason: "NodePool provisioned successfully",
160180
message: "NodePool has 3 nodes running",
161-
observed_generation: 1,
181+
observed_generation: 2,
162182
created_time: "2021-01-01T10:01:00Z",
163183
last_updated_time: "2021-01-01T10:01:00Z",
164184
last_transition_time: "2021-01-01T10:01:00Z",

models/clusters/model.tsp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ model ClusterStatus {
3333
* List of status conditions for the cluster.
3434
*
3535
* **Mandatory conditions**:
36-
* - `type: "Ready"`: Whether all adapters report successfully at the current generation.
36+
* - `type: "Ready"` *(deprecated — use Reconciled)*: Whether all adapters report successfully at the current generation.
37+
* - `type: "Reconciled"`: Whether the resource's desired state has been fully reconciled by all adapters at the current generation.
3738
* - `type: "Available"`: Aggregated adapter result for a common observed_generation.
3839
*
3940
* These conditions are present immediately upon resource creation.

models/common/model.tsp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@ model List<T> {
176176
union ConditionType {
177177
string,
178178
Available: "Available",
179-
Ready: "Ready"
179+
Ready: "Ready",
180+
Reconciled: "Reconciled"
180181
}
181182

182183
/**
@@ -246,6 +247,8 @@ model ResourceCondition {
246247
const ExampleAvailableMessage: string = "All adapters reported Available True for the same generation";
247248
const ExampleReadyReason: string = "All adapters reported Ready True for the current generation";
248249
const ExampleReadyMessage: string = "All adapters reported Ready True for 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";
249252
const ExampleAdapter1: string = "adapter1";
250253
const ExampleAdapter2: string = "adapter2";
251254
const ExampleAdapter1AppliedReason: string = "Validation job applied";
@@ -254,6 +257,8 @@ model ResourceCondition {
254257
const ExampleAdapter1HealthMessage: string = "All adapter1 runtime operations completed successfully";
255258
const ExampleAdapter1AvaliableReason: string = "This adapter1 is available";
256259
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";
257262
const ExampleAdapter2AppliedReason: string = "Validation job applied";
258263
const ExampleAdapter2AppliedMessage: string = "Adapter2 validation job applied successfully";
259264
const ExampleAdapter2HealthReason: string = "All adapter2 operations completed successfully";

models/nodepools/model.tsp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ model NodePoolStatus {
3030
* List of status conditions for the nodepool.
3131
*
3232
* **Mandatory conditions**:
33-
* - `type: "Ready"`: Whether all adapters report successfully at the current generation.
33+
* - `type: "Ready"` *(deprecated — use Reconciled)*: Whether all adapters report successfully at the current generation.
34+
* - `type: "Reconciled"`: Whether the resource's desired state has been fully reconciled by all adapters at the current generation.
3435
* - `type: "Available"`: Aggregated adapter result for a common observed_generation.
3536
*
3637
* These conditions are present immediately upon resource creation.

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

0 commit comments

Comments
 (0)