Skip to content

Commit

Permalink
feat: add resource index in the crp status (#587)
Browse files Browse the repository at this point in the history
* add resource index in the crp status

* rewording

* fix json

---------

Co-authored-by: Ryan Zhang <[email protected]>
  • Loading branch information
ryanzhang-oss and Ryan Zhang authored Nov 3, 2023
1 parent 1c61d4c commit 85283a2
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
12 changes: 12 additions & 0 deletions apis/placement/v1beta1/clusterresourceplacement_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,18 @@ type ClusterResourcePlacementStatus struct {
// +optional
SelectedResources []ResourceIdentifier `json:"selectedResources,omitempty"`

// Resource index logically represents the generation of the selected resources.
// We take a new snapshot of the selected resources whenever the selection or their content change.
// Each snapshot has a different resource index.
// One resource snapshot can contain multiple clusterResourceSnapshots CRs in order to store large amount of resources.
// To get clusterResourceSnapshot of a given resource index, use the following command:
// `kubectl get ClusterResourceSnapshot --selector=kubernetes-fleet.io/resource-index=$ObservedResourceIndex `
// ObservedResourceIndex is the resource index that the conditions in the ClusterResourcePlacementStatus observe.
// For example, a condition of `ClusterResourcePlacementSynchronized` type
// is observing the synchronization status of the resource snapshot with the resource index $ObservedResourceIndex.
// +optional
ObservedResourceIndex string `json:"observedResourceIndex,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,20 @@ spec:
x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
observedResourceIndex:
description: 'Resource index logically represents the generation of
the selected resources. We take a new snapshot of the selected resources
whenever the selection or their content change. Each snapshot has
a different resource index. One resource snapshot can contain multiple
clusterResourceSnapshots CRs in order to store large amount of resources.
To get clusterResourceSnapshot of a given resource index, use the
following command: `kubectl get ClusterResourceSnapshot --selector=kubernetes-fleet.io/resource-index=$ObservedResourceIndex
` ObservedResourceIndex is the resource index that the conditions
in the ClusterResourcePlacementStatus observe. For example, a condition
of `ClusterResourcePlacementSynchronized` type is observing the
synchronization status of the resource snapshot with the 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 85283a2

Please sign in to comment.