Skip to content

Commit e087787

Browse files
committed
interface: CRP API change to support multiple resourceSnapshot versions across clusters
Signed-off-by: Wantong Jiang <wantjian@microsoft.com>
1 parent 9c67ff9 commit e087787

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

apis/placement/v1beta1/clusterresourceplacement_types.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,9 @@ type ClusterResourcePlacementStatus struct {
822822
// One resource snapshot can contain multiple clusterResourceSnapshots CRs in order to store large amount of resources.
823823
// To get clusterResourceSnapshot of a given resource index, use the following command:
824824
// `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.
825828
// ObservedResourceIndex is the resource index that the conditions in the ClusterResourcePlacementStatus observe.
826829
// For example, a condition of `ClusterResourcePlacementWorkSynchronized` type
827830
// is observing the synchronization status of the resource snapshot with the resource index $ObservedResourceIndex.
@@ -954,6 +957,13 @@ type ResourcePlacementStatus struct {
954957
// +kubebuilder:validation:MaxItems=100
955958
DiffedPlacements []DiffedResourcePlacement `json:"diffedPlacements,omitempty"`
956959

960+
// ObservedResourceIndex is the index of the resource snapshot that is currently rolled out on the given cluster.
961+
// During rollout, depending on the rollout strategy, clusters may observe different resource indices.
962+
// ObservedResourceIndex is the resource snapshot index observed by the conditions in the ResourcePlacementStatus.
963+
// This field is only meaningful if the `ClusterName` is not empty.
964+
// +kubebuilder:validation:Optional
965+
ObservedResourceIndex string `json:"observedResourceIndex,omitempty"`
966+
957967
// Conditions is an array of current observed conditions for ResourcePlacementStatus.
958968
// +kubebuilder:validation:Optional
959969
Conditions []metav1.Condition `json:"conditions,omitempty"`

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2044,6 +2044,9 @@ 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.
20472050
ObservedResourceIndex is the resource index that the conditions in the ClusterResourcePlacementStatus observe.
20482051
For example, a condition of `ClusterResourcePlacementWorkSynchronized` type
20492052
is observing the synchronization status of the resource snapshot with the resource index $ObservedResourceIndex.
@@ -2500,6 +2503,13 @@ spec:
25002503
type: object
25012504
maxItems: 100
25022505
type: array
2506+
observedResourceIndex:
2507+
description: |-
2508+
ObservedResourceIndex is the index of the resource snapshot that is currently rolled out on the given cluster.
2509+
During rollout, depending on the rollout strategy, clusters may observe different resource indices.
2510+
ObservedResourceIndex is the resource snapshot index observed by the conditions in the ResourcePlacementStatus.
2511+
This field is only meaningful if the `ClusterName` is not empty.
2512+
type: string
25032513
type: object
25042514
type: array
25052515
selectedResources:

0 commit comments

Comments
 (0)