Skip to content

Commit

Permalink
feat: add generation related fields to policy snapshot status (#428)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelawyu authored Jul 12, 2023
1 parent 28dc945 commit 3626749
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apis/placement/v1beta1/commons.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ const (

// FleetResourceLabelKey is that label that indicates the resource is a fleet resource.
FleetResourceLabelKey = fleetPrefix + "isFleetResource"

// CRPGenerationAnnotation is the annotation that indicates the generation of the CRP from
// which an object is derived or last updated.
CRPGenerationAnnotation = fleetPrefix + "CRPGeneration"
)

const (
Expand Down
6 changes: 6 additions & 0 deletions apis/placement/v1beta1/policysnapshot_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ type SchedulingPolicySnapshotSpec struct {
type SchedulingPolicySnapshotStatus struct {
// +patchMergeKey=type
// +patchStrategy=merge

// ObservedCRPGeneration is the generation of the CRP which the scheduler uses to perform
// the scheduling cycle and prepare the scheduling status.
// +required
ObservedCRPGeneration int64 `json:"observedCRPGeneration"`

// +listType=map
// +listMapKey=type

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,12 @@ spec:
x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
observedCRPGeneration:
description: ObservedCRPGeneration is the generation of the CRP which
the scheduler uses to perform the scheduling cycle and prepare the
scheduling status.
format: int64
type: integer
targetClusters:
description: ClusterDecisions contains a list of names of member clusters
considered by the scheduler. Note that all the selected clusters
Expand Down Expand Up @@ -434,6 +440,8 @@ spec:
type: object
maxItems: 1000
type: array
required:
- observedCRPGeneration
type: object
required:
- spec
Expand Down

0 comments on commit 3626749

Please sign in to comment.