Get rid of katelloAgentPresent and related code

AFAIK, katelloAgent is deprecated and it actually can not work with pulp3.

Would it make sense, to remove all references of katelloAgentPresent and remove and fix the related code?

Actually, Katello took over the katello-agent related parts. So you’re correct Pulp 3 completely removed katello-agent, it can still work.

Today there is no replacement yet. A lot of effort is put into building a MQTT-based replacement with REX but that’s not ready yet. Once it is ready we probably want to give users a chance to migrate before removing it.

I heard it will be several Katello releases after the replacement is ready (and it is not yet ready) before Katello agent can be expected to be removed, so some way off yet…

You can already disable the agent infrastructure (qpid & friends) since Foreman 2.5: Feature #32037: Disable katello-agent and infrastructure by default and allow users to enable it on new installs or disable it on upgrades - Installer - Foreman

IIRC it’s sufficient to pass --foreman-proxy-content-enable-katello-agent false to the installer and it should also clean up bits.

1 Like

With the latest change of Fixes #34743 - Disable update all if no katello-agent by parthaa · Pull Request #10051 · Katello/katello · GitHub, update RPM-based host should still be done via katello-agent but the “Update All packages” button should be hidden, if no katello-agent is available.

Wouldn’t it be better to change the code in the backend to use REX to update the packages instead of using katello-agent? Something like this (not ready because outdated git base):

diff --git a/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages.controller.js b/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages.controller.js
index 4deff05374..796ef041fe 100644
--- a/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages.controller.js
+++ b/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages.controller.js
@@ -45,7 +45,7 @@ angular.module('Bastion.content-hosts').controller('ContentHostPackagesControlle
 
         $scope.updateAll = function () {
             $scope.working = true;
-            HostPackage.updateAll({id: $scope.host.id}, $scope.openEventInfo, $scope.errorHandler);
+            $scope.performPackageAction('packageUpdate', '');
         };
 
         $scope.performPackageAction = function (actionType, term) {
diff --git a/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-actions.html b/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-actions.html
index 8763673ff0..e84fbc63f8 100644
--- a/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-actions.html
+++ b/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-actions.html
@@ -60,7 +60,7 @@
         <div class="form-group">
           <button class="btn btn-default" type="button"
                   translate
-                  ng-disabled="!katelloAgentPresent || working"
+                  ng-disabled="working || !remoteExecutionPresent"
                   ng-click="updateAll()">
             Update All Packages
           </button>
1 Like

Opinion to ^ @katello?

I had read over this and was trying to understand the proposal. I think the code snippet is what confused me as I was trying to understand what the high level question was with respect to REX vs. katello-agent.

Well, the code snippet shows, that there is a better solution than to disable the “Update all packages”.
AFAIK, currently “Update all packages” is disabled for RPM-based systems, if katello-agent is not installed. My suggestion would be, to use REX instead of katello-agent to update all packages - this is what the code snippet does.

That sounds entirely reasonable and a good change. I’d just open a PR for it or a Redmine to track it.

See Fixes #34743 - Allow RPM updateAll package action by sbernhard · Pull Request #10109 · Katello/katello · GitHub

1 Like