Implement kubernetes.bootstrap_labels (#3257)

Allow to define labels that will be assigned to a postgres instance pod when in 'initializing new cluster', 'running custom bootstrap script', 'starting after custom bootstrap', or 'creating replica' state
This commit is contained in:
Polina Bungina
2025-02-18 09:37:22 +01:00
committed by GitHub
parent ce79152088
commit 5dbfc9401b
16 changed files with 140 additions and 27 deletions
+6
View File
@@ -3,12 +3,18 @@ import argparse
import subprocess
import sys
from time import sleep
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--datadir", required=True)
parser.add_argument("--dbname", required=True)
parser.add_argument("--walmethod", required=True, choices=("fetch", "stream", "none"))
parser.add_argument("--sleep", required=False, type=int)
args, _ = parser.parse_known_args()
if args.sleep:
sleep(args.sleep)
walmethod = ["-X", args.walmethod] if args.walmethod != "none" else []
sys.exit(subprocess.call(["pg_basebackup", "-D", args.datadir, "-c", "fast", "-d", args.dbname] + walmethod))