Skip to content

Commit 1890ad9

Browse files
committed
revise
Signed-off-by: Wantong Jiang <wantjian@microsoft.com>
1 parent 1b8449c commit 1890ad9

File tree

2 files changed

+25
-19
lines changed

2 files changed

+25
-19
lines changed

apis/placement/v1beta1/clusterresourceplacement_types.go

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -822,12 +822,10 @@ type ClusterResourcePlacementStatus struct {
822822
// Each snapshot has a different resource index.
823823
// One resource snapshot can contain multiple clusterResourceSnapshots CRs in order to store large amount of resources.
824824
// To get clusterResourceSnapshot of a given resource index, use the following command:
825-
// `kubectl get ClusterResourceSnapshot --selector=kubernetes-fleet.io/resource-index=$ObservedResourceIndex `
826-
// ObservedResourceIndex is the resource index that the conditions in the ClusterResourcePlacementStatus observe.
827-
// For example, a condition of `ClusterResourcePlacementWorkSynchronized` type
828-
// 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`
829826
// 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.
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`.
831829
// +kubebuilder:validation:Optional
832830
ObservedResourceIndex string `json:"observedResourceIndex,omitempty"`
833831

@@ -846,6 +844,11 @@ type ClusterResourcePlacementStatus struct {
846844
// +listMapKey=type
847845

848846
// 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.
849852
// +kubebuilder:validation:Optional
850853
Conditions []metav1.Condition `json:"conditions,omitempty"`
851854
}
@@ -958,13 +961,13 @@ type ResourcePlacementStatus struct {
958961
DiffedPlacements []DiffedResourcePlacement `json:"diffedPlacements,omitempty"`
959962

960963
// ObservedResourceIndex is the index of the resource snapshot that is currently being rolled out to the given cluster.
961-
// During rollout, depending on the rollout strategy, clusters may observe different resource snapshot indices.
962-
// ObservedResourceIndex is the resource snapshot index observed by the conditions in the ResourcePlacementStatus.
963964
// This field is only meaningful if the `ClusterName` is not empty.
964965
// +kubebuilder:validation:Optional
965966
ObservedResourceIndex string `json:"observedResourceIndex,omitempty"`
966967

967-
// 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`.
968971
// +kubebuilder:validation:Optional
969972
Conditions []metav1.Condition `json:"conditions,omitempty"`
970973
}

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

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1976,8 +1976,13 @@ spec:
19761976
description: The observed status of ClusterResourcePlacement.
19771977
properties:
19781978
conditions:
1979-
description: Conditions is an array of current observed conditions
1980-
for ClusterResourcePlacement.
1979+
description: |-
1980+
Conditions is an array of current observed conditions for ClusterResourcePlacement.
1981+
All conditions except `ClusterResourcePlacementScheduled` correspond to the resource snapshot at the index specified by `ObservedResourceIndex`.
1982+
For example, a condition of `ClusterResourcePlacementWorkSynchronized` type
1983+
is observing the synchronization status of the resource snapshot with index `ObservedResourceIndex`.
1984+
If the rollout strategy type is `External`, and `ObservedResourceIndex` is unset due to clusters reporting different resource indices,
1985+
conditions except `ClusterResourcePlacementScheduled` will be empty or set to Unknown.
19811986
items:
19821987
description: Condition contains details for one aspect of the current
19831988
state of this API Resource.
@@ -2043,12 +2048,10 @@ spec:
20432048
Each snapshot has a different resource index.
20442049
One resource snapshot can contain multiple clusterResourceSnapshots CRs in order to store large amount of resources.
20452050
To get clusterResourceSnapshot of a given resource index, use the following command:
2046-
`kubectl get ClusterResourceSnapshot --selector=kubernetes-fleet.io/resource-index=$ObservedResourceIndex `
2047-
ObservedResourceIndex is the resource index that the conditions in the ClusterResourcePlacementStatus observe.
2048-
For example, a condition of `ClusterResourcePlacementWorkSynchronized` type
2049-
is observing the synchronization status of the resource snapshot with the resource index $ObservedResourceIndex.
2051+
`kubectl get ClusterResourceSnapshot --selector=kubernetes-fleet.io/resource-index=$ObservedResourceIndex`
20502052
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.
2053+
If the rollout strategy type is `External`, rollout and version control are managed by an external controller,
2054+
and this field is not empty only if all targeted clusters observe the same resource index in `PlacementStatuses`.
20522055
type: string
20532056
placementStatuses:
20542057
description: |-
@@ -2099,8 +2102,10 @@ spec:
20992102
If it is not empty, its value should be unique cross all placement decisions for the Placement.
21002103
type: string
21012104
conditions:
2102-
description: Conditions is an array of current observed conditions
2103-
for ResourcePlacementStatus.
2105+
description: |-
2106+
Conditions is an array of current observed conditions on the cluster.
2107+
Each condition corresponds to the resource snapshot at the index specified by `ObservedResourceIndex`.
2108+
For example, the condition of type `RolloutStarted` is observing the rollout status of the resource snapshot with index `ObservedResourceIndex`.
21042109
items:
21052110
description: Condition contains details for one aspect of
21062111
the current state of this API Resource.
@@ -2505,8 +2510,6 @@ spec:
25052510
observedResourceIndex:
25062511
description: |-
25072512
ObservedResourceIndex is the index of the resource snapshot that is currently being rolled out to the given cluster.
2508-
During rollout, depending on the rollout strategy, clusters may observe different resource snapshot indices.
2509-
ObservedResourceIndex is the resource snapshot index observed by the conditions in the ResourcePlacementStatus.
25102513
This field is only meaningful if the `ClusterName` is not empty.
25112514
type: string
25122515
type: object

0 commit comments

Comments
 (0)