@@ -218,19 +218,6 @@ func filterHosts(hosts []*host.Host, filters FilterOptions) []*host.Host {
218218 return filteredHosts
219219}
220220
221- func getSwarmMasters (hosts []* host.Host ) map [string ]string {
222- swarmMasters := make (map [string ]string )
223- for _ , h := range hosts {
224- if h .HostOptions != nil {
225- swarmOptions := h .HostOptions .SwarmOptions
226- if swarmOptions != nil && swarmOptions .Master {
227- swarmMasters [swarmOptions .Discovery ] = h .Name
228- }
229- }
230- }
231- return swarmMasters
232- }
233-
234221func filterHost (host * host.Host , filters FilterOptions ) bool {
235222 driverMatches := matchesDriverName (host , filters .DriverName )
236223 stateMatches := matchesState (host , filters .State )
@@ -240,20 +227,6 @@ func filterHost(host *host.Host, filters FilterOptions) bool {
240227 return driverMatches && stateMatches && nameMatches && labelMatches
241228}
242229
243- func matchesSwarmName (host * host.Host , swarmNames []string , swarmMasters map [string ]string ) bool {
244- if len (swarmNames ) == 0 {
245- return true
246- }
247- for _ , n := range swarmNames {
248- if host .HostOptions != nil && host .HostOptions .SwarmOptions != nil {
249- if strings .EqualFold (n , swarmMasters [host .HostOptions .SwarmOptions .Discovery ]) {
250- return true
251- }
252- }
253- }
254- return false
255- }
256-
257230func matchesDriverName (host * host.Host , driverNames []string ) bool {
258231 if len (driverNames ) == 0 {
259232 return true
0 commit comments