Skip to content

Commit

Permalink
Merge pull request #634 from l1b0k/feat/cni
Browse files Browse the repository at this point in the history
daemon: validate cni request container id
  • Loading branch information
BSWANG authored May 17, 2024
2 parents 0531a1b + 36899a8 commit 8f88b9a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,12 @@ func (n *networkService) GetIPInfo(ctx context.Context, r *rpc.GetInfoRequest) (
Msg: "Unexpected network type, maybe daemon mode changed",
}
}

if oldRes.ContainerID != nil {
if r.K8SPodInfraContainerId != *oldRes.ContainerID {
log.Info("cni request not match stored resource, ignored", "old", *oldRes.ContainerID)
return reply, nil
}
}
netConf := make([]*rpc.NetConf, 0)

err = json.Unmarshal([]byte(oldRes.NetConf), &netConf)
Expand Down

0 comments on commit 8f88b9a

Please sign in to comment.