mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-07-16 17:31:58 +00:00
✨ Add --docker-registry
option to tap
command
This commit is contained in:
parent
034a540530
commit
07bd12e396
@ -46,7 +46,8 @@ func init() {
|
||||
log.Debug().Err(err).Send()
|
||||
}
|
||||
|
||||
tapCmd.Flags().StringP(configStructs.TagLabel, "t", defaultTapConfig.Tag, "The tag of the Docker images that are going to be pulled.")
|
||||
tapCmd.Flags().StringP(configStructs.DockerRegistryLabel, "r", defaultTapConfig.DockerRegistry, "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().Uint16(configStructs.ProxyPortFrontLabel, defaultTapConfig.Front.SrcPort, "Provide a custom port for the front-end proxy/port-forward.")
|
||||
tapCmd.Flags().Uint16(configStructs.ProxyPortHubLabel, defaultTapConfig.Hub.SrcPort, "Provide a custom port for the Hub proxy/port-forward.")
|
||||
tapCmd.Flags().String(configStructs.ProxyHostLabel, defaultTapConfig.ProxyHost, "Provide a custom host for the proxy/port-forward.")
|
||||
|
@ -42,7 +42,8 @@ var proxyDone bool
|
||||
|
||||
func tap() {
|
||||
state.startTime = time.Now()
|
||||
docker.SetTag(config.Config.Tap.Tag)
|
||||
docker.SetRegistry(config.Config.Tap.DockerRegistry)
|
||||
docker.SetTag(config.Config.Tap.DockerTag)
|
||||
|
||||
connector = connect.NewConnector(kubernetes.GetLocalhostOnPort(config.Config.Tap.Hub.SrcPort), connect.DefaultRetries, connect.DefaultTimeout)
|
||||
|
||||
|
@ -13,7 +13,8 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
TagLabel = "tag"
|
||||
DockerRegistryLabel = "docker-registry"
|
||||
DockerTagLabel = "docker-tag"
|
||||
ProxyPortFrontLabel = "proxy-port-front"
|
||||
ProxyPortHubLabel = "proxy-port-hub"
|
||||
ProxyHostLabel = "proxy-host"
|
||||
@ -41,7 +42,8 @@ type FrontConfig struct {
|
||||
type TapConfig struct {
|
||||
Hub HubConfig `yaml:"hub"`
|
||||
Front FrontConfig `yaml:"front"`
|
||||
Tag string `yaml:"tag" default:"latest"`
|
||||
DockerRegistry string `yaml:"docker-registry" default:"docker.io/kubeshark"`
|
||||
DockerTag string `yaml:"docker-tag" default:"latest"`
|
||||
PodRegexStr string `yaml:"regex" default:".*"`
|
||||
ProxyHost string `yaml:"proxy-host" default:"127.0.0.1"`
|
||||
Namespaces []string `yaml:"namespaces"`
|
||||
|
@ -9,16 +9,16 @@ const (
|
||||
)
|
||||
|
||||
var (
|
||||
namespace = "kubeshark"
|
||||
registry = "docker.io/kubeshark"
|
||||
tag = "latest"
|
||||
)
|
||||
|
||||
func GetNamespace() string {
|
||||
return namespace
|
||||
func GetRegistry() string {
|
||||
return registry
|
||||
}
|
||||
|
||||
func SetNamespace(value string) {
|
||||
namespace = value
|
||||
func SetRegistry(value string) {
|
||||
registry = value
|
||||
}
|
||||
|
||||
func GetTag() string {
|
||||
@ -30,7 +30,7 @@ func SetTag(value string) {
|
||||
}
|
||||
|
||||
func getImage(image string) string {
|
||||
return fmt.Sprintf("%s/%s:%s", namespace, image, tag)
|
||||
return fmt.Sprintf("%s/%s:%s", registry, image, tag)
|
||||
}
|
||||
|
||||
func GetHubImage() string {
|
||||
|
Loading…
Reference in New Issue
Block a user