Skip to content

Commit

Permalink
add resource index in the crp status
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Zhang committed Nov 2, 2023
1 parent 759dacd commit b36fcd8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
11 changes: 11 additions & 0 deletions apis/placement/v1beta1/clusterresourceplacement_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,17 @@ type ClusterResourcePlacementStatus struct {
// +optional
SelectedResources []ResourceIdentifier `json:"selectedResources,omitempty"`

// ObservedResourceIndex is the resource index of a group of ClusterResourceSnapshot CR that the conditions in the
// ClusterResourcePlacementStatus observe. For example, a condition of `ClusterResourcePlacementSynchronized` type
// is observing the synchronization status of the resources in group of ClusterResourceSnapshot with the $ObservedResourceIndex.
// ClusterResourceSnapshot is used by the ClusterResourcePlacementStatus controller to store a snapshot of selected resources.
// A new resource index is generated each time a new snapshot is taken when the selected resources content changes.
// One resource snapshot can contain multiple clusterResourceSnapshots CRs in order to store large amount of resources.
// One can find all the clusterResourceSnapshot with the observed resource index by
// `kubectl get ClusterResourceSnapshot --selector=kubernetes-fleet.io/resource-index=$ObservedResourceIndex `
// +optional
ObservedResourceIndex string `json:"observedResourceSnapshots,omitempty"`

// PlacementStatuses contains a list of placement status on the clusters that are selected by PlacementPolicy.
// Each selected cluster according to the latest resource placement is guaranteed to have a corresponding placementStatuses.
// In the pickN case, there are N placement statuses where N = NumberOfClusters; Or in the pickFixed case, there are
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,21 @@ spec:
x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
observedResourceSnapshots:
description: ObservedResourceIndex is the resource index of a group
of ClusterResourceSnapshot CR that the conditions in the ClusterResourcePlacementStatus
observe. For example, a condition of `ClusterResourcePlacementSynchronized`
type is observing the synchronization status of the resources in
group of ClusterResourceSnapshot with the $ObservedResourceIndex.
ClusterResourceSnapshot is used by the ClusterResourcePlacementStatus
controller to store a snapshot of selected resources. A new resource
index is generated each time a new snapshot is taken when the selected
resources content changes. One resource snapshot can contain multiple
clusterResourceSnapshots CRs in order to store large amount of resources.
One can find all the clusterResourceSnapshot with the observed resource
index by `kubectl get ClusterResourceSnapshot --selector=kubernetes-fleet.io/resource-index=$ObservedResourceIndex
`
type: string
placementStatuses:
description: PlacementStatuses contains a list of placement status
on the clusters that are selected by PlacementPolicy. Each selected
Expand Down

0 comments on commit b36fcd8

Please sign in to comment.