You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// RegisterFlagsWithPrefix adds the flags required to config this to the given FlagSet
@@ -91,6 +98,12 @@ func (cfg *MemcachedClientConfig) RegisterFlagsWithPrefix(prefix, description st
91
98
f.DurationVar(&cfg.CBTimeout, prefix+"memcached.circuit-breaker-timeout", 10*time.Second, description+"Duration circuit-breaker remains open after tripping (if zero then 60 seconds is used).")
92
99
f.DurationVar(&cfg.CBInterval, prefix+"memcached.circuit-breaker-interval", 10*time.Second, description+"Reset circuit-breaker counts after this long (if zero then never reset).")
93
100
f.IntVar(&cfg.MaxItemSize, prefix+"memcached.max-item-size", 0, description+"The maximum size of an item stored in memcached. Bigger items are not stored. If set to 0, no maximum size is enforced.")
101
+
f.BoolVar(&cfg.TLSEnabled, prefix+"tls-enabled", false, "Enable TLS in the memcached client. This flag needs to be enabled when any other TLS flag is set. If set to false, insecure connection to memcached server will be used.")
102
+
f.StringVar(&cfg.TLSCertPath, prefix+"tls-cert-path", "", "Path to the client certificate file, which will be used for authenticating with the server. Also requires the key path to be configured.")
103
+
f.StringVar(&cfg.TLSKeyPath, prefix+"tls-key-path", "", "Path to the key file for the client certificate. Also requires the client certificate to be configured.")
104
+
f.StringVar(&cfg.TLSCAPath, prefix+"tls-ca-path", "", "Path to the CA certificates file to validate server certificate against. If not set, the host's root CA certificates are used.")
105
+
f.StringVar(&cfg.TLSServerName, prefix+"tls-server-name", "", "Override the expected name on the server certificate.")
106
+
f.BoolVar(&cfg.TLSInsecureSkipVerify, prefix+"tls-insecure-skip-verify", false, "Skip validating server certificate.")
94
107
}
95
108
96
109
// NewMemcachedClient creates a new MemcacheClient that gets its server list
@@ -103,7 +116,14 @@ func NewMemcachedClient(cfg MemcachedClientConfig, name string, r prometheus.Reg
f.IntVar(&cfg.MaxItemSize, prefix+"max-item-size", 1024*1024, "The maximum size of an item stored in memcached. Bigger items are not stored. If set to 0, no maximum size is enforced.")
34
41
f.BoolVar(&cfg.AutoDiscovery, prefix+"auto-discovery", false, "Use memcached auto-discovery mechanism provided by some cloud provider like GCP and AWS")
f.BoolVar(&cfg.TLSEnabled, prefix+"tls-enabled", false, "Enable TLS in the memcached client. This flag needs to be enabled when any other TLS flag is set. If set to false, insecure connection to memcached server will be used.")
44
+
f.StringVar(&cfg.TLSCertPath, prefix+"tls-cert-path", "", "Path to the client certificate file, which will be used for authenticating with the server. Also requires the key path to be configured.")
45
+
f.StringVar(&cfg.TLSKeyPath, prefix+"tls-key-path", "", "Path to the key file for the client certificate. Also requires the client certificate to be configured.")
46
+
f.StringVar(&cfg.TLSCAPath, prefix+"tls-ca-path", "", "Path to the CA certificates file to validate server certificate against. If not set, the host's root CA certificates are used.")
47
+
f.StringVar(&cfg.TLSServerName, prefix+"tls-server-name", "", "Override the expected name on the server certificate.")
48
+
f.BoolVar(&cfg.TLSInsecureSkipVerify, prefix+"tls-insecure-skip-verify", false, "Skip validating server certificate.")
0 commit comments