Skip to content

Commit

Permalink
pkg: update CurrentContainerID to capture correct group
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavosbarreto committed Mar 23, 2023
1 parent 7723502 commit 17c2b73
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/dockerutils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ func CurrentContainerID() (string, error) {

re := regexp.MustCompilePOSIX(`([0-9]+:[a-z_,=]+.*docker[/-]|(/@)?/var/.+/docker(/.+)?/containers/)([0-9a-f]{64})`)
match := re.FindSubmatch(content)
if match == nil || len(match) != 4 {
if match == nil || len(match) != 5 {
return "", nil
}

return string(match[3]), nil
return string(match[4]), nil
}

func IsRunningInDocker() bool {
Expand Down

0 comments on commit 17c2b73

Please sign in to comment.