Browse code

api/types: move ServiceUpdateOptions to api/types/swarm

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2025/05/19 18:57:13
Showing 13 changed files
... ...
@@ -3,7 +3,6 @@ package swarm // import "github.com/docker/docker/api/server/router/swarm"
3 3
 import (
4 4
 	"context"
5 5
 
6
-	"github.com/docker/docker/api/types"
7 6
 	"github.com/docker/docker/api/types/backend"
8 7
 	"github.com/docker/docker/api/types/container"
9 8
 	"github.com/docker/docker/api/types/swarm"
... ...
@@ -21,7 +20,7 @@ type Backend interface {
21 21
 	GetServices(swarm.ServiceListOptions) ([]swarm.Service, error)
22 22
 	GetService(idOrName string, insertDefaults bool) (swarm.Service, error)
23 23
 	CreateService(swarm.ServiceSpec, string, bool) (*swarm.ServiceCreateResponse, error)
24
-	UpdateService(string, uint64, swarm.ServiceSpec, types.ServiceUpdateOptions, bool) (*swarm.ServiceUpdateResponse, error)
24
+	UpdateService(string, uint64, swarm.ServiceSpec, swarm.ServiceUpdateOptions, bool) (*swarm.ServiceUpdateResponse, error)
25 25
 	RemoveService(string) error
26 26
 	ServiceLogs(context.Context, *backend.LogSelector, *container.LogsOptions) (<-chan *backend.LogMessage, error)
27 27
 	GetNodes(swarm.NodeListOptions) ([]swarm.Node, error)
... ...
@@ -8,7 +8,6 @@ import (
8 8
 
9 9
 	"github.com/containerd/log"
10 10
 	"github.com/docker/docker/api/server/httputils"
11
-	basictypes "github.com/docker/docker/api/types"
12 11
 	"github.com/docker/docker/api/types/backend"
13 12
 	"github.com/docker/docker/api/types/filters"
14 13
 	"github.com/docker/docker/api/types/registry"
... ...
@@ -245,7 +244,7 @@ func (sr *swarmRouter) updateService(ctx context.Context, w http.ResponseWriter,
245 245
 		return errdefs.InvalidParameter(err)
246 246
 	}
247 247
 
248
-	var flags basictypes.ServiceUpdateOptions
248
+	var flags types.ServiceUpdateOptions
249 249
 
250 250
 	// Get returns "" if the header does not exist
251 251
 	flags.EncodedRegistryAuth = r.Header.Get(registry.AuthHeader)
... ...
@@ -46,42 +46,6 @@ func (h *HijackedResponse) CloseWrite() error {
46 46
 	return nil
47 47
 }
48 48
 
49
-// Values for RegistryAuthFrom in ServiceUpdateOptions
50
-const (
51
-	RegistryAuthFromSpec         = "spec"
52
-	RegistryAuthFromPreviousSpec = "previous-spec"
53
-)
54
-
55
-// ServiceUpdateOptions contains the options to be used for updating services.
56
-type ServiceUpdateOptions struct {
57
-	// EncodedRegistryAuth is the encoded registry authorization credentials to
58
-	// use when updating the service.
59
-	//
60
-	// This field follows the format of the X-Registry-Auth header.
61
-	EncodedRegistryAuth string
62
-
63
-	// TODO(stevvooe): Consider moving the version parameter of ServiceUpdate
64
-	// into this field. While it does open API users up to racy writes, most
65
-	// users may not need that level of consistency in practice.
66
-
67
-	// RegistryAuthFrom specifies where to find the registry authorization
68
-	// credentials if they are not given in EncodedRegistryAuth. Valid
69
-	// values are "spec" and "previous-spec".
70
-	RegistryAuthFrom string
71
-
72
-	// Rollback indicates whether a server-side rollback should be
73
-	// performed. When this is set, the provided spec will be ignored.
74
-	// The valid values are "previous" and "none". An empty value is the
75
-	// same as "none".
76
-	Rollback string
77
-
78
-	// QueryRegistry indicates whether the service update requires
79
-	// contacting a registry. A registry may be contacted to retrieve
80
-	// the image digest and manifest, which in turn can be used to update
81
-	// platform or other information about the service.
82
-	QueryRegistry bool
83
-}
84
-
85 49
 // PluginRemoveOptions holds parameters to remove plugins.
86 50
 type PluginRemoveOptions struct {
87 51
 	Force bool
... ...
@@ -220,6 +220,42 @@ type ServiceCreateOptions struct {
220 220
 	QueryRegistry bool
221 221
 }
222 222
 
223
+// Values for RegistryAuthFrom in ServiceUpdateOptions
224
+const (
225
+	RegistryAuthFromSpec         = "spec"
226
+	RegistryAuthFromPreviousSpec = "previous-spec"
227
+)
228
+
229
+// ServiceUpdateOptions contains the options to be used for updating services.
230
+type ServiceUpdateOptions struct {
231
+	// EncodedRegistryAuth is the encoded registry authorization credentials to
232
+	// use when updating the service.
233
+	//
234
+	// This field follows the format of the X-Registry-Auth header.
235
+	EncodedRegistryAuth string
236
+
237
+	// TODO(stevvooe): Consider moving the version parameter of ServiceUpdate
238
+	// into this field. While it does open API users up to racy writes, most
239
+	// users may not need that level of consistency in practice.
240
+
241
+	// RegistryAuthFrom specifies where to find the registry authorization
242
+	// credentials if they are not given in EncodedRegistryAuth. Valid
243
+	// values are "spec" and "previous-spec".
244
+	RegistryAuthFrom string
245
+
246
+	// Rollback indicates whether a server-side rollback should be
247
+	// performed. When this is set, the provided spec will be ignored.
248
+	// The valid values are "previous" and "none". An empty value is the
249
+	// same as "none".
250
+	Rollback string
251
+
252
+	// QueryRegistry indicates whether the service update requires
253
+	// contacting a registry. A registry may be contacted to retrieve
254
+	// the image digest and manifest, which in turn can be used to update
255
+	// platform or other information about the service.
256
+	QueryRegistry bool
257
+}
258
+
223 259
 // ServiceListOptions holds parameters to list services with.
224 260
 type ServiceListOptions struct {
225 261
 	Filters filters.Args
... ...
@@ -158,6 +158,16 @@ type TaskListOptions = swarm.TaskListOptions
158 158
 // Deprecated: use [swarm.ServiceCreateOptions].
159 159
 type ServiceCreateOptions = swarm.ServiceCreateOptions
160 160
 
161
+// ServiceUpdateOptions contains the options to be used for updating services.
162
+//
163
+// Deprecated: use [swarm.ServiceCreateOptions].
164
+type ServiceUpdateOptions = swarm.ServiceUpdateOptions
165
+
166
+const (
167
+	RegistryAuthFromSpec         = swarm.RegistryAuthFromSpec         // Deprecated: use [swarm.RegistryAuthFromSpec].
168
+	RegistryAuthFromPreviousSpec = swarm.RegistryAuthFromPreviousSpec // Deprecated: use [swarm.RegistryAuthFromPreviousSpec].
169
+)
170
+
161 171
 // ServiceListOptions holds parameters to list services with.
162 172
 //
163 173
 // Deprecated: use [swarm.ServiceListOptions].
... ...
@@ -180,7 +180,7 @@ type ServiceAPIClient interface {
180 180
 	ServiceInspectWithRaw(ctx context.Context, serviceID string, options swarm.ServiceInspectOptions) (swarm.Service, []byte, error)
181 181
 	ServiceList(ctx context.Context, options swarm.ServiceListOptions) ([]swarm.Service, error)
182 182
 	ServiceRemove(ctx context.Context, serviceID string) error
183
-	ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec, options types.ServiceUpdateOptions) (swarm.ServiceUpdateResponse, error)
183
+	ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec, options swarm.ServiceUpdateOptions) (swarm.ServiceUpdateResponse, error)
184 184
 	ServiceLogs(ctx context.Context, serviceID string, options container.LogsOptions) (io.ReadCloser, error)
185 185
 	TaskLogs(ctx context.Context, taskID string, options container.LogsOptions) (io.ReadCloser, error)
186 186
 	TaskInspectWithRaw(ctx context.Context, taskID string) (swarm.Task, []byte, error)
... ...
@@ -6,7 +6,6 @@ import (
6 6
 	"net/http"
7 7
 	"net/url"
8 8
 
9
-	"github.com/docker/docker/api/types"
10 9
 	"github.com/docker/docker/api/types/registry"
11 10
 	"github.com/docker/docker/api/types/swarm"
12 11
 	"github.com/docker/docker/api/types/versions"
... ...
@@ -15,7 +14,7 @@ import (
15 15
 // ServiceUpdate updates a Service. The version number is required to avoid conflicting writes.
16 16
 // It should be the value as set *before* the update. You can find this value in the Meta field
17 17
 // of swarm.Service, which can be found using ServiceInspectWithRaw.
18
-func (cli *Client) ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec, options types.ServiceUpdateOptions) (swarm.ServiceUpdateResponse, error) {
18
+func (cli *Client) ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec, options swarm.ServiceUpdateOptions) (swarm.ServiceUpdateResponse, error) {
19 19
 	serviceID, err := trimID("service", serviceID)
20 20
 	if err != nil {
21 21
 		return swarm.ServiceUpdateResponse{}, err
... ...
@@ -9,7 +9,6 @@ import (
9 9
 	"strings"
10 10
 	"testing"
11 11
 
12
-	"github.com/docker/docker/api/types"
13 12
 	"github.com/docker/docker/api/types/swarm"
14 13
 	"github.com/docker/docker/errdefs"
15 14
 	"gotest.tools/v3/assert"
... ...
@@ -21,14 +20,14 @@ func TestServiceUpdateError(t *testing.T) {
21 21
 		client: newMockClient(errorMock(http.StatusInternalServerError, "Server error")),
22 22
 	}
23 23
 
24
-	_, err := client.ServiceUpdate(context.Background(), "service_id", swarm.Version{}, swarm.ServiceSpec{}, types.ServiceUpdateOptions{})
24
+	_, err := client.ServiceUpdate(context.Background(), "service_id", swarm.Version{}, swarm.ServiceSpec{}, swarm.ServiceUpdateOptions{})
25 25
 	assert.Check(t, is.ErrorType(err, errdefs.IsSystem))
26 26
 
27
-	_, err = client.ServiceUpdate(context.Background(), "", swarm.Version{}, swarm.ServiceSpec{}, types.ServiceUpdateOptions{})
27
+	_, err = client.ServiceUpdate(context.Background(), "", swarm.Version{}, swarm.ServiceSpec{}, swarm.ServiceUpdateOptions{})
28 28
 	assert.Check(t, is.ErrorType(err, errdefs.IsInvalidParameter))
29 29
 	assert.Check(t, is.ErrorContains(err, "value is empty"))
30 30
 
31
-	_, err = client.ServiceUpdate(context.Background(), "    ", swarm.Version{}, swarm.ServiceSpec{}, types.ServiceUpdateOptions{})
31
+	_, err = client.ServiceUpdate(context.Background(), "    ", swarm.Version{}, swarm.ServiceSpec{}, swarm.ServiceUpdateOptions{})
32 32
 	assert.Check(t, is.ErrorType(err, errdefs.IsInvalidParameter))
33 33
 	assert.Check(t, is.ErrorContains(err, "value is empty"))
34 34
 }
... ...
@@ -41,7 +40,7 @@ func TestServiceUpdateConnectionError(t *testing.T) {
41 41
 	client, err := NewClientWithOpts(WithAPIVersionNegotiation(), WithHost("tcp://no-such-host.invalid"))
42 42
 	assert.NilError(t, err)
43 43
 
44
-	_, err = client.ServiceUpdate(context.Background(), "service_id", swarm.Version{}, swarm.ServiceSpec{}, types.ServiceUpdateOptions{})
44
+	_, err = client.ServiceUpdate(context.Background(), "service_id", swarm.Version{}, swarm.ServiceSpec{}, swarm.ServiceUpdateOptions{})
45 45
 	assert.Check(t, is.ErrorType(err, IsErrConnectionFailed))
46 46
 }
47 47
 
... ...
@@ -89,7 +88,7 @@ func TestServiceUpdate(t *testing.T) {
89 89
 			}),
90 90
 		}
91 91
 
92
-		_, err := client.ServiceUpdate(context.Background(), "service_id", updateCase.swarmVersion, swarm.ServiceSpec{}, types.ServiceUpdateOptions{})
92
+		_, err := client.ServiceUpdate(context.Background(), "service_id", updateCase.swarmVersion, swarm.ServiceSpec{}, swarm.ServiceUpdateOptions{})
93 93
 		assert.NilError(t, err)
94 94
 	}
95 95
 }
... ...
@@ -13,7 +13,6 @@ import (
13 13
 
14 14
 	"github.com/containerd/log"
15 15
 	"github.com/distribution/reference"
16
-	"github.com/docker/docker/api/types"
17 16
 	"github.com/docker/docker/api/types/backend"
18 17
 	"github.com/docker/docker/api/types/container"
19 18
 	"github.com/docker/docker/api/types/registry"
... ...
@@ -283,7 +282,7 @@ func (c *Cluster) CreateService(s swarm.ServiceSpec, encodedAuth string, queryRe
283 283
 }
284 284
 
285 285
 // UpdateService updates existing service to match new properties.
286
-func (c *Cluster) UpdateService(serviceIDOrName string, version uint64, spec swarm.ServiceSpec, flags types.ServiceUpdateOptions, queryRegistry bool) (*swarm.ServiceUpdateResponse, error) {
286
+func (c *Cluster) UpdateService(serviceIDOrName string, version uint64, spec swarm.ServiceSpec, flags swarm.ServiceUpdateOptions, queryRegistry bool) (*swarm.ServiceUpdateResponse, error) {
287 287
 	var resp *swarm.ServiceUpdateResponse
288 288
 
289 289
 	err := c.lockedManagerAction(func(ctx context.Context, state nodeState) error {
... ...
@@ -328,9 +327,9 @@ func (c *Cluster) UpdateService(serviceIDOrName string, version uint64, spec swa
328 328
 				// shouldn't lose it, and continue to use the one that was already present
329 329
 				var ctnr *swarmapi.ContainerSpec
330 330
 				switch flags.RegistryAuthFrom {
331
-				case types.RegistryAuthFromSpec, "":
331
+				case swarm.RegistryAuthFromSpec, "":
332 332
 					ctnr = currentService.Spec.Task.GetContainer()
333
-				case types.RegistryAuthFromPreviousSpec:
333
+				case swarm.RegistryAuthFromPreviousSpec:
334 334
 					if currentService.PreviousSpec == nil {
335 335
 						return errors.New("service does not have a previous spec")
336 336
 					}
... ...
@@ -18,7 +18,6 @@ import (
18 18
 	"github.com/cloudflare/cfssl/csr"
19 19
 	"github.com/cloudflare/cfssl/helpers"
20 20
 	"github.com/cloudflare/cfssl/initca"
21
-	"github.com/docker/docker/api/types"
22 21
 	"github.com/docker/docker/api/types/container"
23 22
 	"github.com/docker/docker/api/types/network"
24 23
 	"github.com/docker/docker/api/types/swarm"
... ...
@@ -890,7 +889,7 @@ func (s *DockerSwarmSuite) TestAPISwarmServicesUpdateWithName(c *testing.T) {
890 890
 	setInstances(instances)(service)
891 891
 	cli := d.NewClientT(c)
892 892
 	defer cli.Close()
893
-	_, err := cli.ServiceUpdate(ctx, service.Spec.Name, service.Version, service.Spec, types.ServiceUpdateOptions{})
893
+	_, err := cli.ServiceUpdate(ctx, service.Spec.Name, service.Version, service.Spec, swarm.ServiceUpdateOptions{})
894 894
 	assert.NilError(c, err)
895 895
 	poll.WaitOn(c, pollCheck(c, d.CheckActiveContainerCount(ctx), checker.Equals(instances)), poll.WithTimeout(defaultReconciliationTimeout))
896 896
 }
... ...
@@ -3,7 +3,6 @@ package service
3 3
 import (
4 4
 	"testing"
5 5
 
6
-	"github.com/docker/docker/api/types"
7 6
 	swarmtypes "github.com/docker/docker/api/types/swarm"
8 7
 	"github.com/docker/docker/integration/internal/swarm"
9 8
 	"gotest.tools/v3/assert"
... ...
@@ -120,7 +119,7 @@ func TestUpdateReplicatedJob(t *testing.T) {
120 120
 	spec.TaskTemplate.ForceUpdate++
121 121
 
122 122
 	_, err = client.ServiceUpdate(
123
-		ctx, id, service.Version, spec, types.ServiceUpdateOptions{},
123
+		ctx, id, service.Version, spec, swarmtypes.ServiceUpdateOptions{},
124 124
 	)
125 125
 	assert.NilError(t, err)
126 126
 
... ...
@@ -4,7 +4,6 @@ import (
4 4
 	"context"
5 5
 	"testing"
6 6
 
7
-	"github.com/docker/docker/api/types"
8 7
 	"github.com/docker/docker/api/types/container"
9 8
 	"github.com/docker/docker/api/types/filters"
10 9
 	networktypes "github.com/docker/docker/api/types/network"
... ...
@@ -35,7 +34,7 @@ func TestServiceUpdateLabel(t *testing.T) {
35 35
 
36 36
 	// add label to empty set
37 37
 	service.Spec.Labels["foo"] = "bar"
38
-	_, err := cli.ServiceUpdate(ctx, serviceID, service.Version, service.Spec, types.ServiceUpdateOptions{})
38
+	_, err := cli.ServiceUpdate(ctx, serviceID, service.Version, service.Spec, swarmtypes.ServiceUpdateOptions{})
39 39
 	assert.NilError(t, err)
40 40
 	poll.WaitOn(t, serviceSpecIsUpdated(ctx, cli, serviceID, service.Version.Index), swarm.ServicePoll)
41 41
 	service = getService(ctx, t, cli, serviceID)
... ...
@@ -43,21 +42,21 @@ func TestServiceUpdateLabel(t *testing.T) {
43 43
 
44 44
 	// add label to non-empty set
45 45
 	service.Spec.Labels["foo2"] = "bar"
46
-	_, err = cli.ServiceUpdate(ctx, serviceID, service.Version, service.Spec, types.ServiceUpdateOptions{})
46
+	_, err = cli.ServiceUpdate(ctx, serviceID, service.Version, service.Spec, swarmtypes.ServiceUpdateOptions{})
47 47
 	assert.NilError(t, err)
48 48
 	poll.WaitOn(t, serviceSpecIsUpdated(ctx, cli, serviceID, service.Version.Index), swarm.ServicePoll)
49 49
 	service = getService(ctx, t, cli, serviceID)
50 50
 	assert.Check(t, is.DeepEqual(service.Spec.Labels, map[string]string{"foo": "bar", "foo2": "bar"}))
51 51
 
52 52
 	delete(service.Spec.Labels, "foo2")
53
-	_, err = cli.ServiceUpdate(ctx, serviceID, service.Version, service.Spec, types.ServiceUpdateOptions{})
53
+	_, err = cli.ServiceUpdate(ctx, serviceID, service.Version, service.Spec, swarmtypes.ServiceUpdateOptions{})
54 54
 	assert.NilError(t, err)
55 55
 	poll.WaitOn(t, serviceSpecIsUpdated(ctx, cli, serviceID, service.Version.Index), swarm.ServicePoll)
56 56
 	service = getService(ctx, t, cli, serviceID)
57 57
 	assert.Check(t, is.DeepEqual(service.Spec.Labels, map[string]string{"foo": "bar"}))
58 58
 
59 59
 	delete(service.Spec.Labels, "foo")
60
-	_, err = cli.ServiceUpdate(ctx, serviceID, service.Version, service.Spec, types.ServiceUpdateOptions{})
60
+	_, err = cli.ServiceUpdate(ctx, serviceID, service.Version, service.Spec, swarmtypes.ServiceUpdateOptions{})
61 61
 	assert.NilError(t, err)
62 62
 	poll.WaitOn(t, serviceSpecIsUpdated(ctx, cli, serviceID, service.Version.Index), swarm.ServicePoll)
63 63
 	service = getService(ctx, t, cli, serviceID)
... ...
@@ -65,7 +64,7 @@ func TestServiceUpdateLabel(t *testing.T) {
65 65
 
66 66
 	// now make sure we can add again
67 67
 	service.Spec.Labels["foo"] = "bar"
68
-	_, err = cli.ServiceUpdate(ctx, serviceID, service.Version, service.Spec, types.ServiceUpdateOptions{})
68
+	_, err = cli.ServiceUpdate(ctx, serviceID, service.Version, service.Spec, swarmtypes.ServiceUpdateOptions{})
69 69
 	assert.NilError(t, err)
70 70
 	poll.WaitOn(t, serviceSpecIsUpdated(ctx, cli, serviceID, service.Version.Index), swarm.ServicePoll)
71 71
 	service = getService(ctx, t, cli, serviceID)
... ...
@@ -112,7 +111,7 @@ func TestServiceUpdateSecrets(t *testing.T) {
112 112
 			SecretName: secretName,
113 113
 		},
114 114
 	)
115
-	_, err = cli.ServiceUpdate(ctx, serviceID, service.Version, service.Spec, types.ServiceUpdateOptions{})
115
+	_, err = cli.ServiceUpdate(ctx, serviceID, service.Version, service.Spec, swarmtypes.ServiceUpdateOptions{})
116 116
 	assert.NilError(t, err)
117 117
 	poll.WaitOn(t, serviceIsUpdated(ctx, cli, serviceID), swarm.ServicePoll)
118 118
 
... ...
@@ -127,7 +126,7 @@ func TestServiceUpdateSecrets(t *testing.T) {
127 127
 
128 128
 	// remove
129 129
 	service.Spec.TaskTemplate.ContainerSpec.Secrets = []*swarmtypes.SecretReference{}
130
-	_, err = cli.ServiceUpdate(ctx, serviceID, service.Version, service.Spec, types.ServiceUpdateOptions{})
130
+	_, err = cli.ServiceUpdate(ctx, serviceID, service.Version, service.Spec, swarmtypes.ServiceUpdateOptions{})
131 131
 	assert.NilError(t, err)
132 132
 	poll.WaitOn(t, serviceIsUpdated(ctx, cli, serviceID), swarm.ServicePoll)
133 133
 	service = getService(ctx, t, cli, serviceID)
... ...
@@ -174,7 +173,7 @@ func TestServiceUpdateConfigs(t *testing.T) {
174 174
 			ConfigName: configName,
175 175
 		},
176 176
 	)
177
-	_, err = cli.ServiceUpdate(ctx, serviceID, service.Version, service.Spec, types.ServiceUpdateOptions{})
177
+	_, err = cli.ServiceUpdate(ctx, serviceID, service.Version, service.Spec, swarmtypes.ServiceUpdateOptions{})
178 178
 	assert.NilError(t, err)
179 179
 	poll.WaitOn(t, serviceIsUpdated(ctx, cli, serviceID), swarm.ServicePoll)
180 180
 
... ...
@@ -189,7 +188,7 @@ func TestServiceUpdateConfigs(t *testing.T) {
189 189
 
190 190
 	// remove
191 191
 	service.Spec.TaskTemplate.ContainerSpec.Configs = []*swarmtypes.ConfigReference{}
192
-	_, err = cli.ServiceUpdate(ctx, serviceID, service.Version, service.Spec, types.ServiceUpdateOptions{})
192
+	_, err = cli.ServiceUpdate(ctx, serviceID, service.Version, service.Spec, swarmtypes.ServiceUpdateOptions{})
193 193
 	assert.NilError(t, err)
194 194
 	poll.WaitOn(t, serviceIsUpdated(ctx, cli, serviceID), swarm.ServicePoll)
195 195
 	service = getService(ctx, t, cli, serviceID)
... ...
@@ -232,7 +231,7 @@ func TestServiceUpdateNetwork(t *testing.T) {
232 232
 
233 233
 	// Remove network from service
234 234
 	service.Spec.TaskTemplate.Networks = []swarmtypes.NetworkAttachmentConfig{}
235
-	_, err = cli.ServiceUpdate(ctx, serviceID, service.Version, service.Spec, types.ServiceUpdateOptions{})
235
+	_, err = cli.ServiceUpdate(ctx, serviceID, service.Version, service.Spec, swarmtypes.ServiceUpdateOptions{})
236 236
 	assert.NilError(t, err)
237 237
 	poll.WaitOn(t, serviceIsUpdated(ctx, cli, serviceID), swarm.ServicePoll)
238 238
 
... ...
@@ -300,7 +299,7 @@ func TestServiceUpdatePidsLimit(t *testing.T) {
300 300
 					service.Spec.TaskTemplate.Resources.Limits = &swarmtypes.Limit{}
301 301
 				}
302 302
 				service.Spec.TaskTemplate.Resources.Limits.Pids = tc.pidsLimit
303
-				_, err := cli.ServiceUpdate(ctx, serviceID, service.Version, service.Spec, types.ServiceUpdateOptions{})
303
+				_, err := cli.ServiceUpdate(ctx, serviceID, service.Version, service.Spec, swarmtypes.ServiceUpdateOptions{})
304 304
 				assert.NilError(t, err)
305 305
 				poll.WaitOn(t, serviceIsUpdated(ctx, cli, serviceID), swarm.ServicePoll)
306 306
 			}
... ...
@@ -5,7 +5,6 @@ import (
5 5
 	"testing"
6 6
 	"time"
7 7
 
8
-	"github.com/docker/docker/api/types"
9 8
 	"github.com/docker/docker/api/types/filters"
10 9
 	"github.com/docker/docker/api/types/swarm"
11 10
 	"gotest.tools/v3/assert"
... ...
@@ -82,7 +81,7 @@ func (d *Daemon) UpdateService(ctx context.Context, t testing.TB, service *swarm
82 82
 		fn(service)
83 83
 	}
84 84
 
85
-	_, err := cli.ServiceUpdate(ctx, service.ID, service.Version, service.Spec, types.ServiceUpdateOptions{})
85
+	_, err := cli.ServiceUpdate(ctx, service.ID, service.Version, service.Spec, swarm.ServiceUpdateOptions{})
86 86
 	assert.NilError(t, err)
87 87
 }
88 88