allow to override docker image in kubesphere config

Signed-off-by: Roland.Ma <rolandma@kubesphere.io>
This commit is contained in:
Roland.Ma
2021-11-03 09:36:40 +00:00
parent 4d87f5969c
commit 4050e5d388
5 changed files with 34 additions and 15 deletions

View File

@@ -26,6 +26,8 @@ import (
type Options struct {
WatchesPath string `json:"watchesPath,omitempty" yaml:"watchesPath"`
Namespace string `json:"namespace,omitempty" yaml:"namespace"`
Repository string `json:"repository,omitempty" yaml:"repository"`
Tag string `json:"tag,omitempty" yaml:"tag"`
}
// NewGatewayOptions creates a default Gateway Option
@@ -33,6 +35,8 @@ func NewGatewayOptions() *Options {
return &Options{
WatchesPath: "",
Namespace: "", //constants.KubeSphereControlNamespace
Repository: "",
Tag: "",
}
}
@@ -59,4 +63,6 @@ func (s *Options) ApplyTo(options *Options) {
func (s *Options) AddFlags(fs *pflag.FlagSet, c *Options) {
fs.StringVar(&s.WatchesPath, "watches-path", c.WatchesPath, "Path to the watches file to use.")
fs.StringVar(&s.Namespace, "namespace", c.Namespace, "Working Namespace of the Gateway's Ingress Controller.")
fs.StringVar(&s.Repository, "repository", c.Repository, "The Gateway Controller's image repository")
fs.StringVar(&s.Tag, "tag", c.Tag, "The Gateway Controller's image tag")
}