diff --git a/cmd/tap.go b/cmd/tap.go index 3ace90ff7..98704e0bc 100644 --- a/cmd/tap.go +++ b/cmd/tap.go @@ -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.") diff --git a/cmd/tapRunner.go b/cmd/tapRunner.go index 6d1cd8968..b4c7fe347 100644 --- a/cmd/tapRunner.go +++ b/cmd/tapRunner.go @@ -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) diff --git a/config/configStructs/tapConfig.go b/config/configStructs/tapConfig.go index 25b90befa..e1c23e353 100644 --- a/config/configStructs/tapConfig.go +++ b/config/configStructs/tapConfig.go @@ -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"` diff --git a/docker/images.go b/docker/images.go index 1f7b473d4..ad54c4a2d 100644 --- a/docker/images.go +++ b/docker/images.go @@ -9,16 +9,16 @@ const ( ) var ( - namespace = "kubeshark" - tag = "latest" + 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 {