@@ -110,6 +110,74 @@ type WorkResourceIdentifier struct {
110110 Name string `json:"name,omitempty"`
111111}
112112
113+ // DriftDetails describes the observed configuration drifts.
114+ type DriftDetails struct {
115+ // ObservationTime is the timestamp when the drift was last detected.
116+ //
117+ // +kubebuilder:validation:Required
118+ // +kubebuilder:validation:Type=string
119+ // +kubebuilder:validation:Format=date-time
120+ ObservationTime metav1.Time `json:"observationTime"`
121+
122+ // ObservedInMemberClusterGeneration is the generation of the applied manifest on the member
123+ // cluster side.
124+ // +kubebuilder:validation:Required
125+ ObservedInMemberClusterGeneration int64 `json:"observedInMemberClusterGeneration"`
126+
127+ // FirstDriftedObservedTime is the timestamp when the drift was first detected.
128+ //
129+ // +kubebuilder:validation:Required
130+ // +kubebuilder:validation:Type=string
131+ // +kubebuilder:validation:Format=date-time
132+ FirstDriftedObservedTime metav1.Time `json:"firstDriftedObservedTime"`
133+
134+ // ObservedDrifts describes each drifted field found from the applied manifest.
135+ // Fleet might truncate the details as appropriate to control object size.
136+ //
137+ // Each entry specifies how the live state (the state on the member cluster side) compares
138+ // against the desired state (the state kept in the hub cluster manifest).
139+ //
140+ // +kubebuilder:validation:Optional
141+ ObservedDrifts []PatchDetail `json:"observedDrifts,omitempty"`
142+ }
143+
144+ // DiffDetails describes the observed configuration differences.
145+ type DiffDetails struct {
146+ // ObservationTime is the timestamp when the configuration difference was last detected.
147+ //
148+ // +kubebuilder:validation:Required
149+ // +kubebuilder:validation:Type=string
150+ // +kubebuilder:validation:Format=date-time
151+ ObservationTime metav1.Time `json:"observationTime"`
152+
153+ // ObservedInMemberClusterGeneration is the generation of the applied manifest on the member
154+ // cluster side.
155+ //
156+ // This might be nil if the resource has not been created yet in the member cluster.
157+ //
158+ // +kubebuilder:validation:Optional
159+ ObservedInMemberClusterGeneration * int64 `json:"observedInMemberClusterGeneration"`
160+
161+ // FirstDiffedObservedTime is the timestamp when the configuration difference
162+ // was first detected.
163+ //
164+ // +kubebuilder:validation:Required
165+ // +kubebuilder:validation:Type=string
166+ // +kubebuilder:validation:Format=date-time
167+ FirstDiffedObservedTime metav1.Time `json:"firstDiffedObservedTime"`
168+
169+ // ObservedDiffs describes each field with configuration difference as found from the
170+ // member cluster side.
171+ //
172+ // Fleet might truncate the details as appropriate to control object size.
173+ //
174+ // Each entry specifies how the live state (the state on the member cluster side) compares
175+ // against the desired state (the state kept in the hub cluster manifest).
176+ //
177+ // +kubebuilder:validation:Optional
178+ ObservedDiffs []PatchDetail `json:"observedDiffs,omitempty"`
179+ }
180+
113181// ManifestCondition represents the conditions of the resources deployed on
114182// spoke cluster.
115183type ManifestCondition struct {
@@ -120,6 +188,28 @@ type ManifestCondition struct {
120188 // Conditions represents the conditions of this resource on spoke cluster
121189 // +required
122190 Conditions []metav1.Condition `json:"conditions"`
191+
192+ // DriftDetails explains about the observed configuration drifts.
193+ // Fleet might truncate the details as appropriate to control object size.
194+ //
195+ // Note that configuration drifts can only occur on a resource if it is currently owned by
196+ // Fleet and its corresponding placement is set to use the ClientSideApply or ServerSideApply
197+ // apply strategy. In other words, DriftDetails and DiffDetails will not be populated
198+ // at the same time.
199+ //
200+ // +kubebuilder:validation:Optional
201+ DriftDetails * DriftDetails `json:"driftDetails,omitempty"`
202+
203+ // DiffDetails explains the details about the observed configuration differences.
204+ // Fleet might truncate the details as appropriate to control object size.
205+ //
206+ // Note that configuration differences can only occur on a resource if it is not currently owned
207+ // by Fleet (i.e., it is a pre-existing resource that needs to be taken over), or if its
208+ // corresponding placement is set to use the ReportDiff apply strategy. In other words,
209+ // DiffDetails and DriftDetails will not be populated at the same time.
210+ //
211+ // +kubebuilder:validation:Optional
212+ DiffDetails * DiffDetails `json:"diffDetails,omitempty"`
123213}
124214
125215// +genclient
0 commit comments