Added comments and cleanup var

This commit is contained in:
Gianluca Arbezzano 2017-08-28 11:01:09 +02:00
parent 5a5fa7a0ad
commit 661d016253
No known key found for this signature in database
GPG Key ID: 9505D2809E1D6180

View File

@ -40,9 +40,10 @@ func (p SwarmProvider) Name() string {
func (p SwarmProvider) Scale(serviceId string, target int, direction bool) error {
ctx := context.Background()
// Correct bug #41 using docker/docker v17.06.1-ce-rc4
siopts := types.ServiceInspectOptions{}
siopts.InsertDefaults = true
service, _, err := p.dockerClient.ServiceInspectWithRaw(ctx, serviceId, siopts)
// Service inspect returns a service showing default values in empty fields
service, _, err := p.dockerClient.ServiceInspectWithRaw(ctx, serviceId, types.ServiceInspectOptions{
InsertDefaults: true,
})
if err != nil {
logrus.WithFields(logrus.Fields{
"error": err.Error(),