@@ -23,7 +23,7 @@ import (
2323 "time"
2424
2525 "github.com/spf13/pflag"
26- "k8s.io/api/core/v1"
26+ corev1 "k8s.io/api/core/v1"
2727
2828 "github.com/presslabs/mysql-operator/pkg/util"
2929)
@@ -49,7 +49,7 @@ type Options struct {
4949 MetricsExporterImage string
5050
5151 ImagePullSecretName string
52- ImagePullPolicy v1 .PullPolicy
52+ ImagePullPolicy corev1 .PullPolicy
5353
5454 OrchestratorURI string
5555 OrchestratorTopologyPassword string
@@ -58,9 +58,12 @@ type Options struct {
5858 JobCompleteSuccessGraceTime time.Duration
5959
6060 HTTPServeAddr string
61+
62+ LeaderElectionNamespace string
63+ LeaderElectionID string
6164}
6265
63- type pullpolicy v1 .PullPolicy
66+ type pullpolicy corev1 .PullPolicy
6467
6568func (pp * pullpolicy ) String () string {
6669 return string (* pp )
@@ -76,7 +79,7 @@ func (pp *pullpolicy) Type() string {
7679}
7780
7881// nolint: unparam
79- func newPullPolicyValue (defaultValue v1 .PullPolicy , v * v1 .PullPolicy ) * pullpolicy {
82+ func newPullPolicyValue (defaultValue corev1 .PullPolicy , v * corev1 .PullPolicy ) * pullpolicy {
8083 * v = defaultValue
8184 return (* pullpolicy )(v )
8285}
@@ -88,12 +91,15 @@ const (
8891 defaultMysqlImage = "percona:5.7-stretch"
8992 defaultExporterImage = "prom/mysqld-exporter:latest"
9093
91- defaultImagePullPolicy = v1 .PullIfNotPresent
94+ defaultImagePullPolicy = corev1 .PullIfNotPresent
9295
9396 defaultOrchestratorTopologyUser = ""
9497 defaultOrchestratorTopologyPassword = ""
9598
9699 defaultHTTPServerAddr = ":80"
100+
101+ defaultLeaderElectionNamespace = "default"
102+ defaultLeaderElectionID = ""
97103)
98104
99105var (
@@ -126,6 +132,11 @@ func (o *Options) AddFlags(fs *pflag.FlagSet) {
126132
127133 fs .StringVar (& o .HTTPServeAddr , "http-serve-addr" , defaultHTTPServerAddr ,
128134 "The address for http server." )
135+
136+ fs .StringVar (& o .LeaderElectionNamespace , "leader-election-namespace" , defaultLeaderElectionNamespace ,
137+ "The leader election namespace." )
138+ fs .StringVar (& o .LeaderElectionID , "leader-election-id" , defaultLeaderElectionID ,
139+ "The leader election id." )
129140}
130141
131142var instance * Options
0 commit comments