@@ -2,15 +2,11 @@ import "../common/model.tsp";
22import "./example_adapter_status.tsp" ;
33
44/**
5- * Condition represents a single status condition
6- * Used in both AdapterStatus.conditions[] (with standard types like "Available")
7- * and ClusterStatus.conditions[] (with semantic types like "ValidationSuccessful", "DNSSuccessful", etc.)
5+ * Base condition fields shared by all condition types
86 */
9- model Condition {
7+ model ConditionBase {
108 /**
119 * Condition type
12- * In AdapterStatus: Standard Kubernetes types ("Available", "Applied", "Health")
13- * In ClusterStatus: Semantic types ("ValidationSuccessful", "DNSSuccessful", "NodePoolSuccessful", etc.)
1410 */
1511 type : string ;
1612
@@ -29,6 +25,29 @@ model Condition {
2925 */
3026 message ? : string ;
3127
28+ /**
29+ * When this condition last transitioned status (API-managed)
30+ * Only updated when status changes (True/False/Unknown), not when reason/message changes
31+ */
32+ @ format ("date-time" ) last_transition_time : string ;
33+ }
34+
35+ /**
36+ * Condition in AdapterStatus
37+ * Used for standard Kubernetes condition types: "Available", "Applied", "Health"
38+ * Note: observed_generation is at AdapterStatus level, not per-condition,
39+ * since all conditions in one AdapterStatus share the same observed generation
40+ */
41+ model AdapterCondition extends ConditionBase {
42+ // No additional fields - inherits all fields from ConditionBase
43+ }
44+
45+ /**
46+ * Condition in Cluster/NodePool status
47+ * Used for semantic condition types: "ValidationSuccessful", "DNSSuccessful", "NodePoolSuccessful", etc.
48+ * Includes observed_generation and last_updated_time to track adapter-specific state
49+ */
50+ model ResourceCondition extends ConditionBase {
3251 /**
3352 * Generation of the spec that this condition reflects
3453 */
@@ -40,39 +59,28 @@ model Condition {
4059 @ format ("date-time" ) created_time : string ;
4160
4261 /**
43- * When this condition was last updated (API-managed)
62+ * When the corresponding adapter last reported (API-managed)
63+ * Updated every time the adapter POSTs, even if condition status hasn't changed
64+ * Copied from AdapterStatus.last_report_time
4465 */
4566 @ format ("date-time" ) last_updated_time : string ;
46-
47- /**
48- * When this condition last transitioned status (API-managed)
49- */
50- @ format ("date-time" ) last_transition_time ? : string ;
5167}
5268
5369/**
5470 * Condition data for create/update requests (from adapters)
71+ * observed_generation and observed_time are now at AdapterStatusCreateRequest level
5572 */
5673model ConditionRequest {
5774 type : string ;
5875 status : "True" | "False" | "Unknown" ;
5976 reason ? : string ;
6077 message ? : string ;
61- observed_generation : int32 ;
62-
63- /**
64- * When the adapter observed this condition
65- * API will use this to set created_time, last_updated_time, last_transition_time
66- */
67- @ format ("date-time" ) observed_time : string ;
6878}
6979
7080/**
71- * AdapterStatus represents the complete status report from an adapter
72- * Contains multiple conditions, job metadata, and adapter-specific data
81+ * Base fields shared by AdapterStatus and AdapterStatusCreateRequest
7382 */
74- @ example (exampleAdapterStatus )
75- model AdapterStatus {
83+ model AdapterStatusBase {
7684 /**
7785 * Adapter name (e.g., "validator", "dns", "provisioner")
7886 */
@@ -83,12 +91,6 @@ model AdapterStatus {
8391 */
8492 observed_generation : int32 ;
8593
86- /**
87- * Kubernetes-style conditions tracking adapter state
88- * Typically includes: Available, Applied, Health
89- */
90- conditions : Condition [];
91-
9294 /**
9395 * Job execution metadata
9496 */
@@ -105,35 +107,45 @@ model AdapterStatus {
105107 * Adapter-specific data (structure varies by adapter type)
106108 */
107109 data ? : Record <unknown >;
110+ }
111+
112+ /**
113+ * AdapterStatus represents the complete status report from an adapter
114+ * Contains multiple conditions, job metadata, and adapter-specific data
115+ */
116+ @ example (exampleAdapterStatus )
117+ model AdapterStatus extends AdapterStatusBase {
118+ /**
119+ * Kubernetes-style conditions tracking adapter state
120+ * Typically includes: Available, Applied, Health
121+ */
122+ conditions : AdapterCondition [];
108123
109124 /**
110125 * When this adapter status was first created (API-managed)
111126 */
112127 @ format ("date-time" ) created_time : string ;
113128
114129 /**
115- * When this adapter status was last updated (API-managed)
130+ * When this adapter last reported its status (API-managed)
131+ * Updated every time the adapter POSTs, even if conditions haven't changed
132+ * Used by Sentinel to detect adapter liveness
116133 */
117- @ format ("date-time" ) last_updated_time : string ;
134+ @ format ("date-time" ) last_report_time : string ;
118135}
119136
120137/**
121138 * Request payload for creating/updating adapter status
122139 */
123140@ example (exampleAdapterStatusCreateRequest )
124- model AdapterStatusCreateRequest {
125- adapter : string ;
126- observed_generation : int32 ;
141+ model AdapterStatusCreateRequest extends AdapterStatusBase {
142+ /**
143+ * When the adapter observed this resource state
144+ * API will use this to set AdapterStatus.last_report_time
145+ */
146+ @ format ("date-time" ) observed_time : string ;
147+
127148 conditions : ConditionRequest [];
128- metadata ? : {
129- job_name ? : string ;
130- job_namespace ? : string ;
131- attempt ? : int32 ;
132- @ format ("date-time" ) started_time ? : string ;
133- @ format ("date-time" ) completed_time ? : string ;
134- duration ? : string ;
135- };
136- data ? : Record <unknown >;
137149}
138150
139151/**
0 commit comments