@@ -211,7 +211,7 @@ func (cache *snapshotCache) sendHeartbeats(ctx context.Context, node string) {
211211 if watch .subscription .IsWildcard () {
212212 resourcesToReturn = make (map [string ]* internal.CachedResource , len (resources ))
213213 for _ , res := range resources {
214- // Include wildcard-eligible resources for wildcard subscriptions (ODCDS support)
214+ // Include wildcard-eligible resources for wildcard subscriptions
215215 if ! res .OnDemandOnly () {
216216 addResource (res )
217217 }
@@ -521,7 +521,7 @@ func createResponse(snapshot ResourceSnapshot, watch ResponseWatch, ads bool) (*
521521 if watch .subscription .IsWildcard () {
522522 changedResources = make (map [string ]struct {}, len (resources ))
523523 for name , res := range resources {
524- // Include wildcard-eligible resources for wildcard subscriptions (ODCDS support)
524+ // Include wildcard-eligible resources for wildcard subscriptions
525525 if res .OnDemandOnly () {
526526 continue
527527 }
@@ -559,20 +559,12 @@ func createResponse(snapshot ResourceSnapshot, watch ResponseWatch, ads bool) (*
559559 continue
560560 }
561561
562- if watch .subscription .IsWildcard () {
563- // For wildcard subscriptions: delete if resource is on-demand only AND not explicitly subscribed
564- if ! res .OnDemandOnly () {
565- continue
566- }
562+ if watch .subscription .IsWildcard () && ! res .OnDemandOnly () {
563+ continue
564+ }
567565
568- if _ , explicitlySubscribed := subscribedResources [name ]; ! explicitlySubscribed {
569- deletedResources = append (deletedResources , name )
570- }
571- } else {
572- // For non-wildcard subscriptions, check if resource is no longer watched
573- if _ , explicitlySubscribed := subscribedResources [name ]; ! explicitlySubscribed {
574- deletedResources = append (deletedResources , name )
575- }
566+ if _ , explicitlySubscribed := subscribedResources [name ]; ! explicitlySubscribed {
567+ deletedResources = append (deletedResources , name )
576568 }
577569 }
578570
@@ -591,7 +583,7 @@ func createResponse(snapshot ResourceSnapshot, watch ResponseWatch, ads bool) (*
591583 resourcesToReturn = make ([]* internal.CachedResource , 0 , len (resources ))
592584 returnedResources = make (map [string ]string , len (resources ))
593585 for name , resource := range resources {
594- // Include wildcard-eligible resources for wildcard subscriptions (ODCDS support)
586+ // Include wildcard-eligible resources for wildcard subscriptions
595587 if ! resource .OnDemandOnly () {
596588 resourcesToReturn = append (resourcesToReturn , resource )
597589 returnedResources [name ] = version
@@ -606,7 +598,6 @@ func createResponse(snapshot ResourceSnapshot, watch ResponseWatch, ads bool) (*
606598 if ! ok {
607599 continue
608600 }
609- // Check if already added (for ODCDS: wildcard + explicit subscriptions)
610601 if _ , alreadyAdded := returnedResources [name ]; ! alreadyAdded {
611602 resourcesToReturn = append (resourcesToReturn , resource )
612603 returnedResources [name ] = version
@@ -738,7 +729,7 @@ func createDeltaResponse(snapshot ResourceSnapshot, watch DeltaResponseWatch, re
738729
739730 if watch .subscription .IsWildcard () {
740731 for _ , res := range resources {
741- // Include wildcard-eligible resources for wildcard subscriptions (ODCDS support)
732+ // Include wildcard-eligible resources for wildcard subscriptions
742733 if ! res .OnDemandOnly () {
743734 if err := addIfChanged (res ); err != nil {
744735 return nil , fmt .Errorf ("failed to compute resource version for %s: %w" , res .Name , err )
0 commit comments