@@ -813,6 +813,7 @@ type RollingUpdateConfig struct {
813813// ClusterResourcePlacementStatus defines the observed state of the ClusterResourcePlacement object.
814814type ClusterResourcePlacementStatus struct {
815815 // SelectedResources contains a list of resources selected by ResourceSelectors.
816+ // This field is only meaningful if the `ObservedResourceIndex` is not empty.
816817 // +kubebuilder:validation:Optional
817818 SelectedResources []ResourceIdentifier `json:"selectedResources,omitempty"`
818819
@@ -821,15 +822,15 @@ type ClusterResourcePlacementStatus struct {
821822 // Each snapshot has a different resource index.
822823 // One resource snapshot can contain multiple clusterResourceSnapshots CRs in order to store large amount of resources.
823824 // To get clusterResourceSnapshot of a given resource index, use the following command:
824- // `kubectl get ClusterResourceSnapshot --selector=kubernetes-fleet.io/resource-index=$ObservedResourceIndex `
825- // ObservedResourceIndex is the resource index that the conditions in the ClusterResourcePlacementStatus observe .
826- // For example, a condition of `ClusterResourcePlacementWorkSynchronized` type
827- // is observing the synchronization status of the resource snapshot with the resource index $ObservedResourceIndex .
825+ // `kubectl get ClusterResourceSnapshot --selector=kubernetes-fleet.io/resource-index=$ObservedResourceIndex`
826+ // If the rollout strategy type is `RollingUpdate`, `ObservedResourceIndex` is the default-latest resource snapshot index .
827+ // If the rollout strategy type is `External`, rollout and version control are managed by an external controller,
828+ // and this field is not empty only if all targeted clusters observe the same resource index in `PlacementStatuses` .
828829 // +kubebuilder:validation:Optional
829830 ObservedResourceIndex string `json:"observedResourceIndex,omitempty"`
830831
831832 // PlacementStatuses contains a list of placement status on the clusters that are selected by PlacementPolicy.
832- // Each selected cluster according to the latest resource placement is guaranteed to have a corresponding placementStatuses.
833+ // Each selected cluster according to the observed resource placement is guaranteed to have a corresponding placementStatuses.
833834 // In the pickN case, there are N placement statuses where N = NumberOfClusters; Or in the pickFixed case, there are
834835 // N placement statuses where N = ClusterNames.
835836 // In these cases, some of them may not have assigned clusters when we cannot fill the required number of clusters.
@@ -843,6 +844,11 @@ type ClusterResourcePlacementStatus struct {
843844 // +listMapKey=type
844845
845846 // Conditions is an array of current observed conditions for ClusterResourcePlacement.
847+ // All conditions except `ClusterResourcePlacementScheduled` correspond to the resource snapshot at the index specified by `ObservedResourceIndex`.
848+ // For example, a condition of `ClusterResourcePlacementWorkSynchronized` type
849+ // is observing the synchronization status of the resource snapshot with index `ObservedResourceIndex`.
850+ // If the rollout strategy type is `External`, and `ObservedResourceIndex` is unset due to clusters reporting different resource indices,
851+ // conditions except `ClusterResourcePlacementScheduled` will be empty or set to Unknown.
846852 // +kubebuilder:validation:Optional
847853 Conditions []metav1.Condition `json:"conditions,omitempty"`
848854}
@@ -907,6 +913,11 @@ type ResourcePlacementStatus struct {
907913 // +kubebuilder:validation:Optional
908914 ClusterName string `json:"clusterName,omitempty"`
909915
916+ // ObservedResourceIndex is the index of the resource snapshot that is currently being rolled out to the given cluster.
917+ // This field is only meaningful if the `ClusterName` is not empty.
918+ // +kubebuilder:validation:Optional
919+ ObservedResourceIndex string `json:"observedResourceIndex,omitempty"`
920+
910921 // ApplicableResourceOverrides contains a list of applicable ResourceOverride snapshots associated with the selected
911922 // resources.
912923 //
@@ -954,7 +965,9 @@ type ResourcePlacementStatus struct {
954965 // +kubebuilder:validation:MaxItems=100
955966 DiffedPlacements []DiffedResourcePlacement `json:"diffedPlacements,omitempty"`
956967
957- // Conditions is an array of current observed conditions for ResourcePlacementStatus.
968+ // Conditions is an array of current observed conditions on the cluster.
969+ // Each condition corresponds to the resource snapshot at the index specified by `ObservedResourceIndex`.
970+ // For example, the condition of type `RolloutStarted` is observing the rollout status of the resource snapshot with index `ObservedResourceIndex`.
958971 // +kubebuilder:validation:Optional
959972 Conditions []metav1.Condition `json:"conditions,omitempty"`
960973}
0 commit comments