1
1
//
2
2
// DISCLAIMER
3
3
//
4
- // Copyright 2017-2024 ArangoDB GmbH, Cologne, Germany
4
+ // Copyright 2017-2023 ArangoDB GmbH, Cologne, Germany
5
5
//
6
6
// Licensed under the Apache License, Version 2.0 (the "License");
7
7
// you may not use this file except in compliance with the License.
@@ -33,7 +33,7 @@ import (
33
33
34
34
// peerServers
35
35
type peerServers struct {
36
- HasAgentFlag * bool `json:"HasAgent,omitempty"` // If set, this peer is running an agent
36
+ HasAgentFlag bool `json:"HasAgent"` // If set, this peer is running an agent
37
37
HasDBServerFlag * bool `json:"HasDBServer,omitempty"` // If set or is nil, this peer is running a dbserver
38
38
HasCoordinatorFlag * bool `json:"HasCoordinator,omitempty"` // If set or is nil, this peer is running a coordinator
39
39
HasResilientSingleFlag bool `json:"HasResilientSingle,omitempty"` // If set, this peer is running a resilient single server
@@ -61,12 +61,8 @@ func preparePeerServers(mode ServiceMode, bsCfg BootstrapConfig, config Config)
61
61
if ! boolFromRef (bsCfg .StartCoordinator , true ) {
62
62
hasCoordinator = boolRef (false )
63
63
}
64
- var hasAgent * bool
65
- if ! boolFromRef (bsCfg .StartAgent , ! mode .IsSingleMode ()) {
66
- hasAgent = boolRef (false )
67
- }
68
64
return peerServers {
69
- HasAgentFlag : hasAgent ,
65
+ HasAgentFlag : boolFromRef ( bsCfg . StartAgent , ! mode . IsSingleMode ()) ,
70
66
HasDBServerFlag : hasDBServer ,
71
67
HasCoordinatorFlag : hasCoordinator ,
72
68
HasResilientSingleFlag : boolFromRef (bsCfg .StartResilientSingle , mode .IsActiveFailoverMode ()),
@@ -89,7 +85,7 @@ func newPeer(id, address string, port, portOffset int, dataDir string, servers p
89
85
}
90
86
91
87
// HasAgent returns true if this peer is running an agent
92
- func (p Peer ) HasAgent () bool { return p .HasAgentFlag == nil || * p . HasAgentFlag }
88
+ func (p Peer ) HasAgent () bool { return p .HasAgentFlag }
93
89
94
90
// HasDBServer returns true if this peer is running a dbserver
95
91
func (p Peer ) HasDBServer () bool { return p .HasDBServerFlag == nil || * p .HasDBServerFlag }
0 commit comments