Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add resource index in the crp status #587

Merged
merged 3 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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