mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-06-24 23:34:45 +00:00
🔨 Define DockerConfig
This commit is contained in:
parent
23b6dd220a
commit
1dec62e50c
@ -46,8 +46,8 @@ func init() {
|
|||||||
log.Debug().Err(err).Send()
|
log.Debug().Err(err).Send()
|
||||||
}
|
}
|
||||||
|
|
||||||
tapCmd.Flags().StringP(configStructs.DockerRegistryLabel, "r", defaultTapConfig.DockerRegistry, "The Docker registry that's hosting the images.")
|
tapCmd.Flags().StringP(configStructs.DockerRegistryLabel, "r", defaultTapConfig.Docker.Registry, "The Docker registry that's hosting the images.")
|
||||||
tapCmd.Flags().StringP(configStructs.DockerTagLabel, "t", defaultTapConfig.DockerTag, "The tag of the Docker images that are going to be pulled.")
|
tapCmd.Flags().StringP(configStructs.DockerTagLabel, "t", defaultTapConfig.Docker.Tag, "The tag of the Docker images that are going to be pulled.")
|
||||||
tapCmd.Flags().Uint16(configStructs.ProxyPortFrontLabel, defaultTapConfig.Proxy.Front.SrcPort, "Provide a custom port for the front-end proxy/port-forward.")
|
tapCmd.Flags().Uint16(configStructs.ProxyPortFrontLabel, defaultTapConfig.Proxy.Front.SrcPort, "Provide a custom port for the front-end proxy/port-forward.")
|
||||||
tapCmd.Flags().Uint16(configStructs.ProxyPortHubLabel, defaultTapConfig.Proxy.Hub.SrcPort, "Provide a custom port for the Hub proxy/port-forward.")
|
tapCmd.Flags().Uint16(configStructs.ProxyPortHubLabel, defaultTapConfig.Proxy.Hub.SrcPort, "Provide a custom port for the Hub proxy/port-forward.")
|
||||||
tapCmd.Flags().String(configStructs.ProxyHostLabel, defaultTapConfig.Proxy.Host, "Provide a custom host for the proxy/port-forward.")
|
tapCmd.Flags().String(configStructs.ProxyHostLabel, defaultTapConfig.Proxy.Host, "Provide a custom host for the proxy/port-forward.")
|
||||||
|
@ -228,8 +228,8 @@ func stopAndRemoveContainers(
|
|||||||
}
|
}
|
||||||
|
|
||||||
func pcap(tarPath string) {
|
func pcap(tarPath string) {
|
||||||
docker.SetRegistry(config.Config.Tap.DockerRegistry)
|
docker.SetRegistry(config.Config.Tap.Docker.Registry)
|
||||||
docker.SetTag(config.Config.Tap.DockerTag)
|
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())
|
||||||
|
@ -40,8 +40,8 @@ var proxyDone bool
|
|||||||
|
|
||||||
func tap() {
|
func tap() {
|
||||||
state.startTime = time.Now()
|
state.startTime = time.Now()
|
||||||
docker.SetRegistry(config.Config.Tap.DockerRegistry)
|
docker.SetRegistry(config.Config.Tap.Docker.Registry)
|
||||||
docker.SetTag(config.Config.Tap.DockerTag)
|
docker.SetTag(config.Config.Tap.Docker.Tag)
|
||||||
log.Info().Str("registry", docker.GetRegistry()).Str("tag", docker.GetTag()).Msg("Using Docker:")
|
log.Info().Str("registry", docker.GetRegistry()).Str("tag", docker.GetTag()).Msg("Using Docker:")
|
||||||
if config.Config.Tap.Pcap != "" {
|
if config.Config.Tap.Pcap != "" {
|
||||||
pcap(config.Config.Tap.Pcap)
|
pcap(config.Config.Tap.Pcap)
|
||||||
|
@ -46,10 +46,14 @@ type ProxyConfig struct {
|
|||||||
Host string `yaml:"host" default:"127.0.0.1"`
|
Host string `yaml:"host" default:"127.0.0.1"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type DockerConfig struct {
|
||||||
|
Registry string `yaml:"registry" default:"docker.io/kubeshark"`
|
||||||
|
Tag string `yaml:"tag" default:"latest"`
|
||||||
|
}
|
||||||
|
|
||||||
type TapConfig struct {
|
type TapConfig struct {
|
||||||
|
Docker DockerConfig `yaml:"docker"`
|
||||||
Proxy ProxyConfig `yaml:"proxy"`
|
Proxy ProxyConfig `yaml:"proxy"`
|
||||||
DockerRegistry string `yaml:"docker-registry" default:"docker.io/kubeshark"`
|
|
||||||
DockerTag string `yaml:"docker-tag" default:"latest"`
|
|
||||||
PodRegexStr string `yaml:"regex" default:".*"`
|
PodRegexStr string `yaml:"regex" default:".*"`
|
||||||
Namespaces []string `yaml:"namespaces"`
|
Namespaces []string `yaml:"namespaces"`
|
||||||
AllNamespaces bool `yaml:"all-namespaces" default:"false"`
|
AllNamespaces bool `yaml:"all-namespaces" default:"false"`
|
||||||
|
Loading…
Reference in New Issue
Block a user