]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
client: reload: added --force flag
authorAleš Mrázek <ales.mrazek@nic.cz>
Tue, 7 Oct 2025 11:47:53 +0000 (13:47 +0200)
committerAleš Mrázek <ales.mrazek@nic.cz>
Wed, 8 Oct 2025 19:40:57 +0000 (21:40 +0200)
doc/user/manager-client.rst
python/knot_resolver/client/commands/reload.py

index 68acc9dcf2b1e0e31e01983fff704f05f4d2639f..5978caabb66beb562f7be91019ad17e60f9a7b76 100644 (file)
@@ -313,6 +313,10 @@ single ``kresctl`` command.
 
     Requires a connection to the management API.
 
+    .. option:: --force
+
+        Force a reload, even if the configuration hasn't changed.
+
 
 .. option:: stop
 
index c1350fc55333efd70a78a4fcbc4c05350f4f448d..26d0a24f6c4779ab5268ae069c9db7e36f9c3c51 100644 (file)
@@ -10,6 +10,7 @@ from knot_resolver.utils.requests import request
 class ReloadCommand(Command):
     def __init__(self, namespace: argparse.Namespace) -> None:
         super().__init__(namespace)
+        self.force: bool = namespace.force
 
     @staticmethod
     def register_args_subparser(
@@ -21,7 +22,12 @@ class ReloadCommand(Command):
             " Old processes are replaced by new ones (with updated configuration) using rolling restarts."
             " So there will be no DNS service unavailability during reload operation.",
         )
-
+        reload.add_argument(
+            "--force",
+            help="Force a reload, even if the configuration hasn't changed.",
+            action="store_true",
+            default=False,
+        )
         return reload, ReloadCommand
 
     @staticmethod
@@ -29,7 +35,7 @@ class ReloadCommand(Command):
         return {}
 
     def run(self, args: CommandArgs) -> None:
-        response = request(args.socket, "POST", "reload")
+        response = request(args.socket, "POST", "reload/force" if self.force else "reload")
 
         if response.status != 200:
             print(response, file=sys.stderr)