From 89359a21ce560f1842d919370507e814b0da96a2 Mon Sep 17 00:00:00 2001 From: congs Date: Mon, 4 Jul 2022 17:13:15 +1200 Subject: [PATCH] fix(docker): EE-3247 Portainer should not send a host information request when host management features are disabled (#7038) --- app/docker/views/host/host-view-controller.js | 2 +- .../views/nodes/node-details/node-details-view-controller.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/docker/views/host/host-view-controller.js b/app/docker/views/host/host-view-controller.js index b9b8ec010..d21bed1c8 100644 --- a/app/docker/views/host/host-view-controller.js +++ b/app/docker/views/host/host-view-controller.js @@ -43,7 +43,7 @@ angular.module('portainer.docker').controller('HostViewController', [ ctrl.state.offlineMode = isOfflineEndpoint(ctrl.endpoint); ctrl.jobs = data.jobs; - if (ctrl.state.isAgent && agentApiVersion > 1) { + if (ctrl.state.isAgent && agentApiVersion > 1 && ctrl.state.enableHostManagementFeatures) { return AgentService.hostInfo(data.info.Hostname).then(function onHostInfoLoad(agentHostInfo) { ctrl.devices = agentHostInfo.PCIDevices; ctrl.disks = agentHostInfo.PhysicalDisks; diff --git a/app/docker/views/nodes/node-details/node-details-view-controller.js b/app/docker/views/nodes/node-details/node-details-view-controller.js index bed849412..c7e1b3478 100644 --- a/app/docker/views/nodes/node-details/node-details-view-controller.js +++ b/app/docker/views/nodes/node-details/node-details-view-controller.js @@ -38,7 +38,7 @@ angular.module('portainer.docker').controller('NodeDetailsViewController', [ if (ctrl.state.isAgent) { var agentApiVersion = applicationState.endpoint.agentApiVersion; ctrl.state.agentApiVersion = agentApiVersion; - if (agentApiVersion < 2) { + if (agentApiVersion < 2 || !ctrl.state.enableHostManagementFeatures) { return; }