Преглед изворни кода

Merge pull request #38069 from harrisonturton/document-service-update

Document ambiguous Version field for ServiceUpdate
Sebastiaan van Stijn пре 6 година
родитељ
комит
bc4c1c238b
1 измењених фајлова са 3 додато и 1 уклоњено
  1. 3 1
      client/service_update.go

+ 3 - 1
client/service_update.go

@@ -10,7 +10,9 @@ import (
 	"github.com/docker/docker/api/types/swarm"
 	"github.com/docker/docker/api/types/swarm"
 )
 )
 
 
-// ServiceUpdate updates a Service.
+// ServiceUpdate updates a Service. The version number is required to avoid conflicting writes.
+// It should be the value as set *before* the update. You can find this value in the Meta field
+// of swarm.Service, which can be found using ServiceInspectWithRaw.
 func (cli *Client) ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec, options types.ServiceUpdateOptions) (types.ServiceUpdateResponse, error) {
 func (cli *Client) ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec, options types.ServiceUpdateOptions) (types.ServiceUpdateResponse, error) {
 	var (
 	var (
 		query   = url.Values{}
 		query   = url.Values{}