@@ -345,8 +345,6 @@ func (cfg *Config) buildXenonConf() []byte {
345
345
"admit-defeat-hearbeat-count": %d,
346
346
"heartbeat-timeout": %d,
347
347
"meta-datadir": "/var/lib/xenon/",
348
- "leader-start-command": "/scripts/leader-start.sh",
349
- "leader-stop-command": "/scripts/leader-stop.sh",
350
348
"semi-sync-degrade": true,
351
349
"purge-binlog-disabled": true,
352
350
"super-idle": false
@@ -408,25 +406,25 @@ func (cfg *Config) buildClientConfig() (*ini.File, error) {
408
406
return conf , nil
409
407
}
410
408
411
- // buildLeaderStart build the leader-start.sh.
412
- func (cfg * Config ) buildLeaderStart () []byte {
413
- str := fmt .Sprintf (`#!/usr/bin/env bash
414
- curl -X PATCH -H "Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" -H "Content-Type: application/json-patch+json" \
415
- --cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_PORT_443_TCP_PORT/api/v1/namespaces/%s/pods/$HOSTNAME \
416
- -d '[{"op": "replace", "path": "/metadata/labels/role", "value": "leader"}]'
417
- ` , cfg .NameSpace )
418
- return utils .StringToBytes (str )
419
- }
420
-
421
- // buildLeaderStop build the leader-stop.sh.
422
- func (cfg * Config ) buildLeaderStop () []byte {
423
- str := fmt .Sprintf (`#!/usr/bin/env bash
424
- curl -X PATCH -H "Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" -H "Content-Type: application/json-patch+json" \
425
- --cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_PORT_443_TCP_PORT/api/v1/namespaces/%s/pods/$HOSTNAME \
426
- -d '[{"op": "replace", "path": "/metadata/labels/role", "value": "follower"}]'
427
- ` , cfg .NameSpace )
428
- return utils .StringToBytes (str )
429
- }
409
+ // // buildLeaderStart build the leader-start.sh.
410
+ // func (cfg *Config) buildLeaderStart() []byte {
411
+ // str := fmt.Sprintf(`#!/usr/bin/env bash
412
+ // curl -X PATCH -H "Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" -H "Content-Type: application/json-patch+json" \
413
+ // --cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_PORT_443_TCP_PORT/api/v1/namespaces/%s/pods/$HOSTNAME \
414
+ // -d '[{"op": "replace", "path": "/metadata/labels/role", "value": "leader"}]'
415
+ // `, cfg.NameSpace)
416
+ // return utils.StringToBytes(str)
417
+ // }
418
+
419
+ // // buildLeaderStop build the leader-stop.sh.
420
+ // func (cfg *Config) buildLeaderStop() []byte {
421
+ // str := fmt.Sprintf(`#!/usr/bin/env bash
422
+ // curl -X PATCH -H "Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" -H "Content-Type: application/json-patch+json" \
423
+ // --cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_PORT_443_TCP_PORT/api/v1/namespaces/%s/pods/$HOSTNAME \
424
+ // -d '[{"op": "replace", "path": "/metadata/labels/role", "value": "follower"}]'
425
+ // `, cfg.NameSpace)
426
+ // return utils.StringToBytes(str)
427
+ // }
430
428
431
429
/* The function is equivalent to the following shell script template:
432
430
#!/bin/sh
0 commit comments