fix: remove ineffectual assignments

- Fix loop variable reassignment in config_handlers.go
- Remove redundant boolean assignments in swarm.go
This commit is contained in:
rcourtman 2025-11-27 09:48:29 +00:00
parent 60cd019d33
commit 16603e8b4a
2 changed files with 2 additions and 8 deletions

View file

@ -805,10 +805,10 @@ func (h *ConfigHandlers) GetAllNodesForAPI() []NodeResponse {
containerSSHBlocked := isContainerSSHRestricted()
// Add PVE nodes
for i, pve := range h.config.PVEInstances {
for i := range h.config.PVEInstances {
// Refresh cluster metadata if we previously failed to detect endpoints
h.maybeRefreshClusterInfo(&h.config.PVEInstances[i])
pve = h.config.PVEInstances[i]
pve := h.config.PVEInstances[i]
node := NodeResponse{
ID: generateNodeID("pve", i),
Type: "pve",

View file

@ -82,12 +82,6 @@ func (a *Agent) collectSwarmData(ctx context.Context, info systemtypes.Info, con
includeTasks := a.cfg.IncludeTasks
if info.Swarm.LocalNodeState != swarmtypes.LocalNodeStateActive {
if !includeServices {
includeServices = false
}
if !includeTasks {
includeTasks = false
}
return nil, nil, swarmInfo
}