def METHOD_NAME():
    argparser = argparse.ArgumentParser()
    argparser.add_argument("--namespace", help="Namespace the secret exists in")
    argparser.add_argument("action", choices=["load", "watch-save"])
    argparser.add_argument(
        "secret_name", help="Name of secret to sync with. Will be created if needed."
    )
    argparser.add_argument("key", help="Key in secret object to sync file to")
    argparser.add_argument("path", help="Path in filesystem to sync to")
    argparser.add_argument(
        "--label",
        help="Labels (of form key=value) to add to the k8s secret when it is created",
        action="append",
    )
    args = argparser.parse_args()
    setup_logging()
    logging.info(str.join(" ", sys.argv))
    if not args.namespace:
        try:
            with open("/var/run/secrets/kubernetes.io/serviceaccount/namespace") as f:
                args.namespace = f.read().strip()
        except FileNotFoundError:
            logging.error(
                "Can not determine a namespace, must be explicitly set with --namespace"
            )
            sys.exit(1)
    if args.action == "load":
        value = get_secret_value(args.namespace, args.secret_name, args.key)
        if value:
            with open(args.path, "wb") as f:
                f.write(value)
                os.fchmod(f.fileno(), 0o600)
    elif args.action == "watch-save":
        labels = {}
        for label in args.label:
            l_splits = label.split("=", 1)
            labels[l_splits[0]] = l_splits[1]
        # FIXME: use inotifiy
        while True:
            if not os.path.exists(args.path):
                logging.warning(f"Watched file {args.path} not found")
            else:
                with open(args.path, "rb") as f:
                    file_content = f.read()
                if not file_content:
                    logging.info(f"Watched file {args.path} is currently empty")
                else:
                    file_dict = json.loads(file_content)
                    for cert_resolver in file_dict.values():
                        if cert_resolver.get("Certificates"):
                            update_secret(
                                args.namespace,
                                args.secret_name,
                                labels,
                                args.key,
                                file_content,
                            )
                            break
                    else:
                        logging.info(f"No certificate detected in {args.path}")
            time.sleep(30)