forked from toolshed/abra
chore: use keyed fields with struct literals
This commit is contained in:
@ -66,19 +66,19 @@ func GetDeployedServicesByLabel(cl *dockerClient.Client, contextName string, lab
|
||||
filters.Add("label", label)
|
||||
services, err := cl.ServiceList(context.Background(), types.ServiceListOptions{Filters: filters})
|
||||
if err != nil {
|
||||
return StackStatus{[]swarm.Service{}, err}
|
||||
return StackStatus{Services: []swarm.Service{}, Err: err}
|
||||
}
|
||||
|
||||
return StackStatus{services, nil}
|
||||
return StackStatus{Services: services, Err: nil}
|
||||
}
|
||||
|
||||
func GetAllDeployedServices(cl *dockerClient.Client, contextName string) StackStatus {
|
||||
services, err := cl.ServiceList(context.Background(), types.ServiceListOptions{Filters: getAllStacksFilter()})
|
||||
if err != nil {
|
||||
return StackStatus{[]swarm.Service{}, err}
|
||||
return StackStatus{Services: []swarm.Service{}, Err: err}
|
||||
}
|
||||
|
||||
return StackStatus{services, nil}
|
||||
return StackStatus{Services: services, Err: nil}
|
||||
}
|
||||
|
||||
// GetDeployedServicesByName filters services by name
|
||||
@ -88,10 +88,10 @@ func GetDeployedServicesByName(ctx context.Context, cl *dockerClient.Client, sta
|
||||
|
||||
services, err := cl.ServiceList(ctx, types.ServiceListOptions{Filters: filters})
|
||||
if err != nil {
|
||||
return StackStatus{[]swarm.Service{}, err}
|
||||
return StackStatus{Services: []swarm.Service{}, Err: err}
|
||||
}
|
||||
|
||||
return StackStatus{services, nil}
|
||||
return StackStatus{Services: services, Err: nil}
|
||||
}
|
||||
|
||||
// IsDeployed chekcks whether an appp is deployed or not.
|
||||
|
Reference in New Issue
Block a user