Skip to content

Commit

Permalink
fix: Strip image ID for dockershim (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasdille authored Dec 14, 2022
1 parent 17fc6c6 commit c056ec8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/vuln/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package kubernetes

import (
"context"
"strings"

"github.com/sirupsen/logrus"
corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -71,7 +72,8 @@ func (client *KubeClient) GetContainersWithImage(imageID string) ([]ContainerInf
statuses = append(statuses, p.Status.EphemeralContainerStatuses...)

for _, c := range statuses {
if c.ImageID == imageID {
fixedImageID := strings.ReplaceAll(c.ImageID, "docker-pullable://", "")
if fixedImageID == imageID {
infos = append(infos, ContainerInfo{
Namespace: p.Namespace,
PodName: p.Name,
Expand Down

0 comments on commit c056ec8

Please sign in to comment.