Skip to content

Conversation

@michaelawyu
Copy link
Collaborator

Description of your changes

This PR adds some experimental API changes that allow status back-reporting.

I have:

  • Run make reviewable to ensure this PR is ready for review.

How has this code been tested

N/A

Special notes for your reviewer

N/A

Signed-off-by: michaelawyu <chenyu1@microsoft.com>
@michaelawyu michaelawyu changed the title api: experimental: status back-reporting apis: experimental: status back-reporting Sep 23, 2025
@michaelawyu michaelawyu changed the title apis: experimental: status back-reporting interface: experimental: status back-reporting Sep 23, 2025
@codecov
Copy link

codecov bot commented Sep 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Signed-off-by: michaelawyu <chenyu1@microsoft.com>
Signed-off-by: michaelawyu <chenyu1@microsoft.com>
Signed-off-by: michaelawyu <chenyu1@microsoft.com>
Copy link
Contributor

@ryanzhang-oss ryanzhang-oss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw, it occurred to me that although we don't use v1 work, it's better to copy all the fields there

Comment on lines 1487 to 1531
type ReportBackStrategyType string

const (
// ReportBackStrategyTypeDisabled disables status back-reporting from the member clusters.
ReportBackStrategyTypeDisabled ReportBackStrategyType = "Disabled"

// ReportBackStrategyTypeMirror enables status back-reporting by
// copying the status fields verbatim to the corresponding objects on the hub cluster side. This is
// only performed when the placement object has a scheduling policy that selects exactly one
// member cluster (i.e., a pickFixed scheduling policy with exactly one cluster name, or
// a pickN scheduling policy with the numberOfClusters field set to 1). If multiple member clusters
// are selected, KubeFleet will fall back to the ReplicatePerCluster strategy, as described below.
ReportBackStrategyTypeMirror ReportBackStrategyType = "Mirror"

// ReportBackStrategyTypeReplicatePerCluster enables status back-reporting by copying
// the status fields verbatim via the Work API on the hub cluster side. Users may look up
// the status of a specific resource applied to a specific member cluster by inspecting the
// corresponding Work object on the hub cluster side.
ReportBackStrategyTypeReplicatePerCluster ReportBackStrategyType = "ReplicatePerCluster"
)

// ReportBackStrategy describes how to report back the resource status from member clusters.
type ReportBackStrategy struct {
// Type dictates the type of the report back strategy to use.
//
// Available options include:
//
// * Disabled: status back-reporting is disabled. This is the default behavior.
//
// * Mirror: status back-reporting is enabled by copying the status fields verbatim to
// the corresponding objects on the hub cluster side. This is only performed when the placement
// object has a scheduling policy that selects exactly one member cluster (i.e., a pickFixed
// scheduling policy with exactly one cluster name, or a pickN scheduling policy with the
// numberOfClusters field set to 1). If multiple member clusters are selected, KubeFleet will
// fall back to the ReplicatePerCluster strategy.
//
// * ReplicatePerCluster: status back-reporting is enabled by copying the status fields verbatim via the Work API
// on the hub cluster side. Users may look up the status of a specific resource applied to a
// specific member cluster by inspecting the corresponding Work object on the hub cluster side.
//
// +kubebuilder:default=Disabled
// +kubebuilder:validation:Enum=Disabled;Mirror;ReplicatePerCluster
// +kubebuilder:validation:Required
Type ReportBackStrategyType `json:"type"`
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be spread out in a different way

const (

// ReportBackStrategyTypeDisabled disables status back-reporting from the member clusters.
ReportBackStrategyTypeDisabled ReportBackType = "Disabled"

// will copy the status back
ReportBackStrategyTypeMirror ReportBackType = "Copy"

)

(

// Propagate to the original resource
ReportBackPropagateTypeOriginal ReportBackPropagateType = "Original"

// Propagate to work only
ReportBackPropagateTypeWork ReportBackPropagateType = "Work"

)

// ReportBackStrategy describes how to report back the resource status from member clusters.
type ReportBackStrategy struct {

 // Type dictates the type of the report back type to use.
Type ReportBackType `json:"type"`

// Type dictates the type of the report back strategy to use.
Type ReportBackPropagateType `json:"type"`

}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that sounds great; let me make the edits

…o api/experimental-status-backport-support
Signed-off-by: michaelawyu <chenyu1@microsoft.com>
Signed-off-by: michaelawyu <chenyu1@microsoft.com>
Signed-off-by: michaelawyu <chenyu1@microsoft.com>
Signed-off-by: michaelawyu <chenyu1@microsoft.com>
@michaelawyu michaelawyu merged commit 76ee739 into kubefleet-dev:main Oct 9, 2025
14 of 16 checks passed
@michaelawyu michaelawyu deleted the api/experimental-status-backport-support branch October 9, 2025 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants