Skip to content

Commit

Permalink
[CWS] remove stack trace debug log in finalize (#28361)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcacheux authored Aug 9, 2024
1 parent fdd75ae commit 5726d40
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions pkg/security/security_profile/dump/activity_dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"io"
"os"
"path/filepath"
"runtime/debug"
"slices"
"strings"
"sync"
Expand Down Expand Up @@ -469,18 +468,12 @@ func (ad *ActivityDump) finalize(releaseTracedCgroupSpot bool) {

// add the container ID in a tag
if len(ad.ContainerID) > 0 {
// check if we already have a container_id tag, and display the stack trace if it's the case
for _, tag := range ad.Tags {
if strings.HasPrefix(tag, "container_id:") {
seclog.Errorf("container_id tag already present in tags (is finalize called multiple times?): %v + %s", ad.Tags, ad.ContainerID)
seclog.Errorf("stack trace: %s", string(debug.Stack()))
}
}

// make sure we are not adding the same tag twice
newTag := fmt.Sprintf("container_id:%s", ad.ContainerID)
if !slices.Contains(ad.Tags, newTag) {
ad.Tags = append(ad.Tags, newTag)
} else {
seclog.Errorf("container_id tag already present in tags (is finalize called multiple times?): %s", newTag)
}
}

Expand Down

0 comments on commit 5726d40

Please sign in to comment.