Add --tag option to deploy command

This commit is contained in:
M. Mert Yildiran 2022-12-11 11:43:10 +03:00
parent e410e273a4
commit 5ad30c2d98
No known key found for this signature in database
GPG Key ID: DA5D6DCBB758A461
3 changed files with 5 additions and 0 deletions

View File

@ -46,6 +46,7 @@ func init() {
log.Debug().Err(err).Send()
}
deployCmd.Flags().StringP(configStructs.TagLabel, "t", defaultDeployConfig.Tag, "The tag of the Docker images that are going to be deployed.")
deployCmd.Flags().Uint16P(configStructs.ProxyPortLabel, "p", defaultDeployConfig.ProxyPort, "Provide a custom port for the web interface webserver.")
deployCmd.Flags().StringSliceP(configStructs.NamespacesLabel, "n", defaultDeployConfig.Namespaces, "Namespaces selector.")
deployCmd.Flags().BoolP(configStructs.AllNamespacesLabel, "A", defaultDeployConfig.AllNamespaces, "Deploy to all namespaces.")

View File

@ -7,6 +7,7 @@ import (
"regexp"
"time"
"github.com/kubeshark/kubeshark/docker"
"github.com/kubeshark/kubeshark/internal/connect"
"github.com/kubeshark/kubeshark/resources"
"github.com/kubeshark/kubeshark/utils"
@ -41,6 +42,7 @@ var proxyDone bool
func deploy() {
state.startTime = time.Now()
docker.SetTag(config.Config.Deploy.Tag)
connector = connect.NewConnector(kubernetes.GetLocalhostOnPort(config.Config.Hub.PortForward.SrcPort), connect.DefaultRetries, connect.DefaultTimeout)

View File

@ -13,6 +13,7 @@ import (
)
const (
TagLabel = "tag"
ProxyPortLabel = "proxy-port"
NamespacesLabel = "namespaces"
AllNamespacesLabel = "all-namespaces"
@ -27,6 +28,7 @@ const (
)
type DeployConfig struct {
Tag string `yaml:"tag" default:"latest"`
PodRegexStr string `yaml:"regex" default:".*"`
ProxyPort uint16 `yaml:"proxy-port" default:"8899"`
ProxyHost string `yaml:"proxy-host" default:"127.0.0.1"`