mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-07-21 03:31:10 +00:00
👕 Fix the linter error
This commit is contained in:
parent
17f9858e6e
commit
af02b1d779
@ -90,7 +90,7 @@ func createAndStartContainers(
|
|||||||
imageFront string,
|
imageFront string,
|
||||||
imageHub string,
|
imageHub string,
|
||||||
imageWorker string,
|
imageWorker string,
|
||||||
pcapReader io.Reader,
|
tarReader io.Reader,
|
||||||
) (
|
) (
|
||||||
respFront container.ContainerCreateCreatedBody,
|
respFront container.ContainerCreateCreatedBody,
|
||||||
respHub container.ContainerCreateCreatedBody,
|
respHub container.ContainerCreateCreatedBody,
|
||||||
@ -167,7 +167,7 @@ func createAndStartContainers(
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = cli.CopyToContainer(ctx, respWorker.ID, "/app/import", pcapReader, types.CopyToContainerOptions{}); err != nil {
|
if err = cli.CopyToContainer(ctx, respWorker.ID, "/app/import", tarReader, types.CopyToContainerOptions{}); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -222,7 +222,7 @@ func stopAndRemoveContainers(
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func pcap(pcapPath string) {
|
func pcap(tarPath string) {
|
||||||
docker.SetRegistry(config.Config.Tap.DockerRegistry)
|
docker.SetRegistry(config.Config.Tap.DockerRegistry)
|
||||||
docker.SetTag(config.Config.Tap.DockerTag)
|
docker.SetTag(config.Config.Tap.DockerTag)
|
||||||
|
|
||||||
@ -244,9 +244,13 @@ func pcap(pcapPath string) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
pcapFile, err := os.Open(pcapPath)
|
tarFile, err := os.Open(tarPath)
|
||||||
defer pcapFile.Close()
|
if err != nil {
|
||||||
pcapReader := bufio.NewReader(pcapFile)
|
log.Error().Err(err).Send()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer tarFile.Close()
|
||||||
|
tarReader := bufio.NewReader(tarFile)
|
||||||
|
|
||||||
respFront, respHub, respWorker, workerIPAddr, err := createAndStartContainers(
|
respFront, respHub, respWorker, workerIPAddr, err := createAndStartContainers(
|
||||||
ctx,
|
ctx,
|
||||||
@ -254,7 +258,7 @@ func pcap(pcapPath string) {
|
|||||||
imageFront,
|
imageFront,
|
||||||
imageHub,
|
imageHub,
|
||||||
imageWorker,
|
imageWorker,
|
||||||
pcapReader,
|
tarReader,
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error().Err(err).Send()
|
log.Error().Err(err).Send()
|
||||||
|
Loading…
Reference in New Issue
Block a user