From 23169cc27d1a573f57584a457423480aca164e1c Mon Sep 17 00:00:00 2001 From: Can Bulut Bayburt <1103552+cbbayburt@users.noreply.github.com> Date: Thu, 21 Sep 2023 14:08:14 +0200 Subject: [PATCH] Sync GPG properties on each build in CLM (bsc#1213689) (#22537) (cherry picked from commit e1ab8bb6179c8ceac33dc3cae1a44df13927bc19) --- .../redhat/rhn/manager/contentmgmt/ContentManager.java | 10 ++++++++++ java/spacewalk-java.changes.cbbayburt.bsc1213689 | 1 + 2 files changed, 11 insertions(+) create mode 100644 java/spacewalk-java.changes.cbbayburt.bsc1213689 diff --git a/java/code/src/com/redhat/rhn/manager/contentmgmt/ContentManager.java b/java/code/src/com/redhat/rhn/manager/contentmgmt/ContentManager.java index f53c413e0e4e..99a53fc2f38c 100644 --- a/java/code/src/com/redhat/rhn/manager/contentmgmt/ContentManager.java +++ b/java/code/src/com/redhat/rhn/manager/contentmgmt/ContentManager.java @@ -775,6 +775,13 @@ private static void stripModuleMetadata(Channel channel) { } } + private static void syncGpgKeyInfo(Channel source, Channel target) { + target.setGPGCheck(source.isGPGCheck()); + target.setGPGKeyFp(source.getGPGKeyFp()); + target.setGPGKeyId(source.getGPGKeyId()); + target.setGPGKeyUrl(source.getGPGKeyUrl()); + } + /** * Clone {@link Channel}s to given {@link ContentEnvironment} * @@ -851,6 +858,9 @@ private static SoftwareEnvironmentTarget fixTargetProperties(SoftwareEnvironment tgt.cloneModulesFrom(newSource); } + // Sync GPG key info to target in case it's updated since last build + syncGpgKeyInfo(newSource, tgt); + return swTgt; } diff --git a/java/spacewalk-java.changes.cbbayburt.bsc1213689 b/java/spacewalk-java.changes.cbbayburt.bsc1213689 new file mode 100644 index 000000000000..98c6fc1d9702 --- /dev/null +++ b/java/spacewalk-java.changes.cbbayburt.bsc1213689 @@ -0,0 +1 @@ +- Sync GPG properties on each build in CLM (bsc#1213689)