Skip to content

Commit

Permalink
Parse container ID in correct way on CRI-O. Fixes argoproj#2095 (argo…
Browse files Browse the repository at this point in the history
  • Loading branch information
rafalbigaj authored Jan 30, 2020
1 parent b6a2be8 commit aece7e6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions workflow/executor/pns/pns.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,10 @@ func parseContainerID(pid int) (string, error) {
if len(parts) > 1 {
if containerID := parts[len(parts)-1]; containerID != "" {
// need to check for empty string because the line may look like: 5:rdma:/

// for crio we need to get rid of "crio-" prefix and ".scope" suffix
// e.g. crio-7a92a067289f6197148912be1c15f20f0330c7f3c541473d3b9c4043ca137b42.scope
containerID := strings.TrimSuffix(strings.TrimPrefix(containerID, "crio-"), ".scope")
return containerID, nil
}
}
Expand Down

0 comments on commit aece7e6

Please sign in to comment.