mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-09-04 12:05:35 +00:00
🔥 Delete the unused docker
package
This commit is contained in:
@@ -25,7 +25,6 @@ import (
|
|||||||
"github.com/docker/go-connections/nat"
|
"github.com/docker/go-connections/nat"
|
||||||
"github.com/kubeshark/kubeshark/config"
|
"github.com/kubeshark/kubeshark/config"
|
||||||
"github.com/kubeshark/kubeshark/config/configStructs"
|
"github.com/kubeshark/kubeshark/config/configStructs"
|
||||||
"github.com/kubeshark/kubeshark/docker"
|
|
||||||
"github.com/kubeshark/kubeshark/internal/connect"
|
"github.com/kubeshark/kubeshark/internal/connect"
|
||||||
"github.com/kubeshark/kubeshark/kubernetes"
|
"github.com/kubeshark/kubeshark/kubernetes"
|
||||||
"github.com/kubeshark/kubeshark/misc"
|
"github.com/kubeshark/kubeshark/misc"
|
||||||
@@ -449,9 +448,6 @@ func pcap(tarPath string) error {
|
|||||||
|
|
||||||
log.Info().Str("tar-path", tarPath).Msg("Openning")
|
log.Info().Str("tar-path", tarPath).Msg("Openning")
|
||||||
|
|
||||||
docker.SetRegistry(config.Config.Tap.Docker.Registry)
|
|
||||||
docker.SetTag(config.Config.Tap.Docker.Tag)
|
|
||||||
|
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
cli, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())
|
cli, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -460,9 +456,9 @@ func pcap(tarPath string) error {
|
|||||||
}
|
}
|
||||||
defer cli.Close()
|
defer cli.Close()
|
||||||
|
|
||||||
imageFront := docker.GetFrontImage()
|
imageFront := fmt.Sprintf("%s%s:%s", config.Config.Tap.Docker.Registry, "front", config.Config.Tap.Docker.Tag)
|
||||||
imageHub := docker.GetHubImage()
|
imageHub := fmt.Sprintf("%s%s:%s", config.Config.Tap.Docker.Registry, "hub", config.Config.Tap.Docker.Tag)
|
||||||
imageWorker := docker.GetWorkerImage()
|
imageWorker := fmt.Sprintf("%s%s:%s", config.Config.Tap.Docker.Registry, "worker", config.Config.Tap.Docker.Tag)
|
||||||
|
|
||||||
err = pullImages(ctx, cli, imageFront, imageHub, imageWorker)
|
err = pullImages(ctx, cli, imageFront, imageHub, imageWorker)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@@ -10,7 +10,6 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/kubeshark/kubeshark/docker"
|
|
||||||
"github.com/kubeshark/kubeshark/internal/connect"
|
"github.com/kubeshark/kubeshark/internal/connect"
|
||||||
"github.com/kubeshark/kubeshark/kubernetes/helm"
|
"github.com/kubeshark/kubeshark/kubernetes/helm"
|
||||||
"github.com/kubeshark/kubeshark/misc"
|
"github.com/kubeshark/kubeshark/misc"
|
||||||
@@ -47,9 +46,7 @@ var ready *Readiness
|
|||||||
func tap() {
|
func tap() {
|
||||||
ready = &Readiness{}
|
ready = &Readiness{}
|
||||||
state.startTime = time.Now()
|
state.startTime = time.Now()
|
||||||
docker.SetRegistry(config.Config.Tap.Docker.Registry)
|
log.Info().Str("registry", config.Config.Tap.Docker.Registry).Str("tag", config.Config.Tap.Docker.Tag).Msg("Using Docker:")
|
||||||
docker.SetTag(config.Config.Tap.Docker.Tag)
|
|
||||||
log.Info().Str("registry", docker.GetRegistry()).Str("tag", docker.GetTag()).Msg("Using Docker:")
|
|
||||||
if config.Config.Tap.Pcap != "" {
|
if config.Config.Tap.Pcap != "" {
|
||||||
err := pcap(config.Config.Tap.Pcap)
|
err := pcap(config.Config.Tap.Pcap)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@@ -1,53 +0,0 @@
|
|||||||
package docker
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"strings"
|
|
||||||
)
|
|
||||||
|
|
||||||
const (
|
|
||||||
hub = "hub"
|
|
||||||
worker = "worker"
|
|
||||||
front = "front"
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
registry = "docker.io/kubeshark/"
|
|
||||||
tag = "latest"
|
|
||||||
)
|
|
||||||
|
|
||||||
func GetRegistry() string {
|
|
||||||
return registry
|
|
||||||
}
|
|
||||||
|
|
||||||
func SetRegistry(value string) {
|
|
||||||
if strings.HasPrefix(value, "docker.io/kubeshark") {
|
|
||||||
registry = "docker.io/kubeshark/"
|
|
||||||
} else {
|
|
||||||
registry = value
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func GetTag() string {
|
|
||||||
return tag
|
|
||||||
}
|
|
||||||
|
|
||||||
func SetTag(value string) {
|
|
||||||
tag = value
|
|
||||||
}
|
|
||||||
|
|
||||||
func getImage(image string) string {
|
|
||||||
return fmt.Sprintf("%s%s:%s", registry, image, tag)
|
|
||||||
}
|
|
||||||
|
|
||||||
func GetHubImage() string {
|
|
||||||
return getImage(hub)
|
|
||||||
}
|
|
||||||
|
|
||||||
func GetWorkerImage() string {
|
|
||||||
return getImage(worker)
|
|
||||||
}
|
|
||||||
|
|
||||||
func GetFrontImage() string {
|
|
||||||
return getImage(front)
|
|
||||||
}
|
|
Reference in New Issue
Block a user