Skip to content

Commit

Permalink
[Bug Fix] fix backward compatibility issue in remote tagger dca server (
Browse files Browse the repository at this point in the history
#31711)

(cherry picked from commit 1c2acb4)
  • Loading branch information
adel121 authored and github-actions[bot] committed Dec 3, 2024
1 parent 273b005 commit 5e86b26
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion comp/core/tagger/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import (
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

"github.com/google/uuid"

tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def"
"github.com/DataDog/datadog-agent/comp/core/tagger/proto"
"github.com/DataDog/datadog-agent/comp/core/tagger/types"
Expand Down Expand Up @@ -57,7 +59,15 @@ func (s *Server) TaggerStreamEntities(in *pb.StreamTagsRequest, out pb.AgentSecu

filter := filterBuilder.Build(cardinality)

subscriptionID := fmt.Sprintf("streaming-client-%s", in.GetStreamingID())
streamingID := in.GetStreamingID()
if streamingID == "" {
// this is done to preserve backward compatibility
// if CLC runner is using an old version, the streaming ID would be an empty string,
// and the server needs to auto-assign a unique id
streamingID = uuid.New().String()
}

subscriptionID := fmt.Sprintf("streaming-client-%s", streamingID)
subscription, err := s.taggerComponent.Subscribe(subscriptionID, filter)
if err != nil {
return err
Expand Down

0 comments on commit 5e86b26

Please sign in to comment.