Blame SOURCES/0009-customize-add-reminder-about-key-ID-clevis.patch

ca2a74
From fe59e93b27e3bc17b5cc0874e103330e0000b210 Mon Sep 17 00:00:00 2001
ca2a74
From: Laszlo Ersek <lersek@redhat.com>
ca2a74
Date: Tue, 28 Jun 2022 13:57:01 +0200
ca2a74
Subject: [PATCH] customize: add reminder about "--key ID:clevis"
ca2a74
ca2a74
virt-customize already enables appliance networking by default;
ca2a74
conversely, if the user passes "--no-network", we shouldn't override that
ca2a74
for the sake of "--key ID:clevis". Add comments about clevis to the code.
ca2a74
ca2a74
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1809453
ca2a74
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
ca2a74
Message-Id: <20220628115702.5584-4-lersek@redhat.com>
ca2a74
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
ca2a74
(cherry picked from commit e52aea48cbcea3f3b538db0573b58517cbc33da0)
ca2a74
---
ca2a74
 customize/customize_main.ml | 7 +++++++
ca2a74
 1 file changed, 7 insertions(+)
ca2a74
ca2a74
diff --git a/customize/customize_main.ml b/customize/customize_main.ml
ca2a74
index 8a022342f..32b7eebdd 100644
ca2a74
--- a/customize/customize_main.ml
ca2a74
+++ b/customize/customize_main.ml
ca2a74
@@ -52,7 +52,11 @@ let main () =
ca2a74
   let libvirturi = ref "" in
ca2a74
   let memsize = ref None in
ca2a74
   let set_memsize arg = memsize := Some arg in
ca2a74
+
ca2a74
+  (* Note that [--key ID:clevis] depends on this default. See more below, near
ca2a74
+   * [g#set_network network]. *)
ca2a74
   let network = ref true in
ca2a74
+
ca2a74
   let smp = ref None in
ca2a74
   let set_smp arg = smp := Some arg in
ca2a74
 
ca2a74
@@ -159,6 +163,9 @@ read the man page virt-customize(1).
ca2a74
     let g = open_guestfs () in
ca2a74
     Option.may g#set_memsize memsize;
ca2a74
     Option.may g#set_smp smp;
ca2a74
+    (* [--no-network] from the command line takes precedence over the automatic
ca2a74
+     * network enablement for [--key ID:clevis], so here we intentionally don't check
ca2a74
+     * [key_store_requires_network opthandle.ks]. *)
ca2a74
     g#set_network network;
ca2a74
 
ca2a74
     (* Add disks. *)
ca2a74
-- 
ca2a74
2.31.1
ca2a74