Skip to content

Commit 339275e

Browse files
committed
revise API
Signed-off-by: Wantong Jiang <wantjian@microsoft.com>
1 parent 7ee85e4 commit 339275e

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

apis/placement/v1beta1/clusterresourceplacement_types.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,7 @@ type RollingUpdateConfig struct {
813813
// ClusterResourcePlacementStatus defines the observed state of the ClusterResourcePlacement object.
814814
type 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

@@ -822,17 +823,16 @@ type ClusterResourcePlacementStatus struct {
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:
824825
// `kubectl get ClusterResourceSnapshot --selector=kubernetes-fleet.io/resource-index=$ObservedResourceIndex `
825-
// During rollout, clusters may run different versions of the resource snapshot concurrently.
826-
// In this case, ObservedResourceIndex represents the index of the latest resource snapshot installed across all clusters.
827-
// Note that this may differ from the index of the latest resource snapshot available in the hub cluster depending on the rollout strategy.
828826
// ObservedResourceIndex is the resource index that the conditions in the ClusterResourcePlacementStatus observe.
829827
// For example, a condition of `ClusterResourcePlacementWorkSynchronized` type
830828
// is observing the synchronization status of the resource snapshot with the resource index $ObservedResourceIndex.
829+
// If the rollout strategy type is `RollingUpdate`, `ObservedResourceIndex` is the default-latest resource snapshot index.
830+
// If the rollout strategy type is `External`, rollout and version control are managed by an external controller, and this field remains empty.
831831
// +kubebuilder:validation:Optional
832832
ObservedResourceIndex string `json:"observedResourceIndex,omitempty"`
833833

834834
// PlacementStatuses contains a list of placement status on the clusters that are selected by PlacementPolicy.
835-
// Each selected cluster according to the latest resource placement is guaranteed to have a corresponding placementStatuses.
835+
// Each selected cluster according to the observed resource placement is guaranteed to have a corresponding placementStatuses.
836836
// In the pickN case, there are N placement statuses where N = NumberOfClusters; Or in the pickFixed case, there are
837837
// N placement statuses where N = ClusterNames.
838838
// In these cases, some of them may not have assigned clusters when we cannot fill the required number of clusters.
@@ -957,7 +957,7 @@ type ResourcePlacementStatus struct {
957957
// +kubebuilder:validation:MaxItems=100
958958
DiffedPlacements []DiffedResourcePlacement `json:"diffedPlacements,omitempty"`
959959

960-
// ObservedResourceIndex is the index of the resource snapshot that is currently rolled out on the given cluster.
960+
// ObservedResourceIndex is the index of the resource snapshot that is currently being rolled out to the given cluster.
961961
// During rollout, depending on the rollout strategy, clusters may observe different resource indices.
962962
// ObservedResourceIndex is the resource snapshot index observed by the conditions in the ResourcePlacementStatus.
963963
// This field is only meaningful if the `ClusterName` is not empty.

config/crd/bases/placement.kubernetes-fleet.io_clusterresourceplacements.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2044,17 +2044,16 @@ spec:
20442044
One resource snapshot can contain multiple clusterResourceSnapshots CRs in order to store large amount of resources.
20452045
To get clusterResourceSnapshot of a given resource index, use the following command:
20462046
`kubectl get ClusterResourceSnapshot --selector=kubernetes-fleet.io/resource-index=$ObservedResourceIndex `
2047-
During rollout, clusters may run different versions of the resource snapshot concurrently.
2048-
In this case, ObservedResourceIndex represents the index of the latest resource snapshot installed across all clusters.
2049-
Note that this may differ from the index of the latest resource snapshot available in the hub cluster depending on the rollout strategy.
20502047
ObservedResourceIndex is the resource index that the conditions in the ClusterResourcePlacementStatus observe.
20512048
For example, a condition of `ClusterResourcePlacementWorkSynchronized` type
20522049
is observing the synchronization status of the resource snapshot with the resource index $ObservedResourceIndex.
2050+
If the rollout strategy type is `RollingUpdate`, `ObservedResourceIndex` is the default-latest resource snapshot index.
2051+
If the rollout strategy type is `External`, rollout and version control are managed by an external controller, and this field remains empty.
20532052
type: string
20542053
placementStatuses:
20552054
description: |-
20562055
PlacementStatuses contains a list of placement status on the clusters that are selected by PlacementPolicy.
2057-
Each selected cluster according to the latest resource placement is guaranteed to have a corresponding placementStatuses.
2056+
Each selected cluster according to the observed resource placement is guaranteed to have a corresponding placementStatuses.
20582057
In the pickN case, there are N placement statuses where N = NumberOfClusters; Or in the pickFixed case, there are
20592058
N placement statuses where N = ClusterNames.
20602059
In these cases, some of them may not have assigned clusters when we cannot fill the required number of clusters.
@@ -2505,16 +2504,17 @@ spec:
25052504
type: array
25062505
observedResourceIndex:
25072506
description: |-
2508-
ObservedResourceIndex is the index of the resource snapshot that is currently rolled out on the given cluster.
2507+
ObservedResourceIndex is the index of the resource snapshot that is currently being rolled out to the given cluster.
25092508
During rollout, depending on the rollout strategy, clusters may observe different resource indices.
25102509
ObservedResourceIndex is the resource snapshot index observed by the conditions in the ResourcePlacementStatus.
25112510
This field is only meaningful if the `ClusterName` is not empty.
25122511
type: string
25132512
type: object
25142513
type: array
25152514
selectedResources:
2516-
description: SelectedResources contains a list of resources selected
2517-
by ResourceSelectors.
2515+
description: |-
2516+
SelectedResources contains a list of resources selected by ResourceSelectors.
2517+
This field is only meaningful if the `ObservedResourceIndex` is not empty.
25182518
items:
25192519
description: ResourceIdentifier identifies one Kubernetes resource.
25202520
properties:

0 commit comments

Comments
 (0)