@@ -74,25 +74,20 @@ type replicationResourceConfig struct {
7474 conditionHandlers conditionReasonHandlers
7575
7676 // mirrorStatusDownstream copies upstream status → downstream status after
77- // each spec sync. Used for resource types whose status is authoritative in
78- // the upstream cluster and must be readable by consumers in the downstream
79- // cluster. When true, skipUpstreamStatusSync is implicitly honoured as well.
77+ // each spec sync, for resource types whose status is authoritative upstream.
78+ // When true, skipUpstreamStatusSync is implicitly honoured as well.
8079 //
81- // NOTE: this does NOT work across a Karmada hub→member boundary — Karmada
82- // propagates a resource template's spec + metadata to members but NOT the
83- // status subresource. For the Connector type (whose downstream consumer, the
84- // edge extension server, lives on a member cluster) use
85- // writeLivenessAnnotation instead, which rides an annotation Karmada does
86- // propagate.
80+ // NOTE: ineffective across a Karmada hub→member boundary — Karmada does not
81+ // propagate the status subresource to members. For the Connector type (read
82+ // by the edge extension server on a member cluster) use
83+ // writeLivenessAnnotation instead.
8784 mirrorStatusDownstream bool
8885
89- // writeLivenessAnnotation, when true, derives a compact liveness snapshot
90- // from the upstream Connector's status and stores it as the
91- // ConnectorLivenessAnnotation on the downstream object's metadata. Karmada
92- // propagates resource-template annotations (but NOT the status subresource)
93- // to member clusters, so this is how connector liveness reaches the edge
94- // extension server. Used instead of mirrorStatusDownstream for the Connector
95- // type. Implies skipUpstreamStatusSync should also be set.
86+ // writeLivenessAnnotation derives a compact liveness snapshot from the
87+ // upstream Connector's status and stores it as ConnectorLivenessAnnotation
88+ // on the downstream object's metadata. Karmada propagates metadata (but not
89+ // status) to members, so this is how connector liveness reaches the edge
90+ // extension server. Implies skipUpstreamStatusSync should also be set.
9691 writeLivenessAnnotation bool
9792
9893 // skipUpstreamStatusSync suppresses the normal downstream→upstream status
@@ -163,13 +158,10 @@ func initReplicationResourceConfigs() map[string]replicationResourceConfig {
163158 }
164159 }
165160
166- // Connector liveness (Ready condition + connectionDetails) is authoritative
167- // upstream and must be readable by the edge extension server so it can
168- // determine whether a tunnel is online before injecting connector cluster
169- // patches. The extension server runs on a member cluster, and Karmada does
170- // not propagate the status subresource hub→member — only spec + metadata.
171- // Carry liveness down through an annotation (which Karmada DOES propagate)
172- // instead of mirroring status. Do not propagate status back upstream.
161+ // Connector liveness (Ready + connectionDetails) is authoritative upstream
162+ // and read by the edge extension server on a member cluster. Karmada does
163+ // not propagate status hub→member, so carry liveness down via an annotation
164+ // instead. Do not propagate status back upstream.
173165 connectorGVK := schema.GroupVersionKind {Group : groupNetworkingDatumAPIs , Version : versionV1Alpha1 , Kind : KindConnector }
174166 configs [gvkKey (connectorGVK )] = replicationResourceConfig {
175167 writeLivenessAnnotation : true ,
@@ -334,10 +326,8 @@ func (r *GatewayResourceReplicatorReconciler) ensureDownstreamResource(
334326 return fmt .Errorf ("failed to set downstream controller reference: %w" , err )
335327 }
336328
337- // Stamp the connector liveness annotation onto the downstream object's
338- // metadata. This is part of the same CreateOrUpdate Update, so it is
339- // persisted as ordinary metadata (which Karmada propagates to members) —
340- // no status subresource write involved.
329+ // Persisted as ordinary metadata via this same CreateOrUpdate Update —
330+ // no status subresource write — so Karmada propagates it to members.
341331 if resource .replicationResourceConfig .writeLivenessAnnotation {
342332 if err := setConnectorLivenessAnnotation (downstreamObj , upstreamObj ); err != nil {
343333 return err
@@ -457,12 +447,10 @@ func (r *GatewayResourceReplicatorReconciler) mirrorUpstreamStatusToDownstream(
457447 return nil
458448}
459449
460- // setConnectorLivenessAnnotation derives a compact liveness snapshot from the
461- // upstream Connector's status and stores it as ConnectorLivenessAnnotation on
462- // the downstream object's metadata. It is the Karmada-friendly replacement for
463- // mirroring the status subresource downstream: Karmada propagates a resource
464- // template's metadata (annotations) to member clusters but not its status, so
465- // the edge extension server reads liveness from this annotation instead.
450+ // setConnectorLivenessAnnotation stamps the upstream Connector's liveness onto
451+ // the downstream object's metadata. Karmada propagates metadata (but not the
452+ // status subresource) to members, so the edge extension server reads liveness
453+ // from this annotation rather than from downstream status.
466454func setConnectorLivenessAnnotation (downstreamObj , upstreamObj * unstructured.Unstructured ) error {
467455 liveness , err := connectorLivenessFromUpstream (upstreamObj )
468456 if err != nil {
@@ -483,10 +471,8 @@ func setConnectorLivenessAnnotation(downstreamObj, upstreamObj *unstructured.Uns
483471 return nil
484472}
485473
486- // connectorLivenessFromUpstream extracts the Ready condition and PublicKey node
487- // ID from an upstream Connector's (unstructured) status. A connector with no
488- // status, a non-True Ready condition, or no PublicKey connection details yields
489- // a not-ready liveness with an empty NodeID.
474+ // connectorLivenessFromUpstream extracts Ready and the PublicKey node ID from an
475+ // upstream Connector's (unstructured) status.
490476func connectorLivenessFromUpstream (upstreamObj * unstructured.Unstructured ) (networkingv1alpha1.ConnectorLiveness , error ) {
491477 var liveness networkingv1alpha1.ConnectorLiveness
492478
0 commit comments