]> git.proxmox.com Git - pve-manager.git/commitdiff
pvestatd: broadcast version info
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 10 Nov 2021 14:11:46 +0000 (15:11 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 10 Nov 2021 20:44:32 +0000 (21:44 +0100)
broadcast the built-in, statically available version info, e.g.:
{
   "release" : "7.0",
   "repoid" : "3ce05d40",
   "version" : "7.0-14"
}

We can expand this by more actual package version info in the future,
but that certainly needs more elaborate update control mechanisms as
the oneshot at boot we have now.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/Service/pvestatd.pm

index 474b3ac0edf7d3c4c179435460981d838d7082a8..b1e71ec8fc00ac39a5f084a00f5c94dff129eb57 100755 (executable)
@@ -28,6 +28,7 @@ use PVE::AutoBalloon;
 use PVE::AccessControl;
 use PVE::Ceph::Services;
 use PVE::Ceph::Tools;
+use PVE::pvecfg;
 
 use PVE::ExtMetric;
 use PVE::Status::Plugin;
@@ -490,6 +491,17 @@ sub update_sdn_status {
     }
 }
 
+my $broadcast_version_info_done = 0;
+my sub broadcast_version_info : prototype() {
+    if (!$broadcast_version_info_done) {
+       PVE::Cluster::broadcast_node_kv(
+           'version-info',
+           encode_json(PVE::pvecfg::version_info()),
+       );
+       $broadcast_version_info_done = 1;
+    }
+}
+
 sub update_status {
 
     # update worker list. This is not really required and
@@ -560,6 +572,11 @@ sub update_status {
     $err = $@;
     syslog('err', "sdn status update error: $err") if $err;
 
+    eval {
+       broadcast_version_info();
+    };
+    $err = $@;
+    syslog('err', "version info update error: $err") if $err;
 }
 
 my $next_update = 0;