@@ -11,6 +11,7 @@ import (
1111 "github.com/docker/cli/internal/test"
1212 "github.com/docker/cli/internal/test/builders"
1313 "github.com/moby/moby/api/types/swarm"
14+ "github.com/moby/moby/client"
1415 "gotest.tools/v3/assert"
1516 is "gotest.tools/v3/assert/cmp"
1617 "gotest.tools/v3/golden"
@@ -19,15 +20,15 @@ import (
1920func TestConfigListErrors (t * testing.T ) {
2021 testCases := []struct {
2122 args []string
22- configListFunc func (context.Context , swarm .ConfigListOptions ) ([]swarm.Config , error )
23+ configListFunc func (context.Context , client .ConfigListOptions ) ([]swarm.Config , error )
2324 expectedError string
2425 }{
2526 {
2627 args : []string {"foo" },
2728 expectedError : "accepts no argument" ,
2829 },
2930 {
30- configListFunc : func (_ context.Context , options swarm .ConfigListOptions ) ([]swarm.Config , error ) {
31+ configListFunc : func (_ context.Context , options client .ConfigListOptions ) ([]swarm.Config , error ) {
3132 return []swarm.Config {}, errors .New ("error listing configs" )
3233 },
3334 expectedError : "error listing configs" ,
@@ -48,7 +49,7 @@ func TestConfigListErrors(t *testing.T) {
4849
4950func TestConfigList (t * testing.T ) {
5051 cli := test .NewFakeCli (& fakeClient {
51- configListFunc : func (_ context.Context , options swarm .ConfigListOptions ) ([]swarm.Config , error ) {
52+ configListFunc : func (_ context.Context , options client .ConfigListOptions ) ([]swarm.Config , error ) {
5253 return []swarm.Config {
5354 * builders .Config (builders .ConfigID ("ID-1-foo" ),
5455 builders .ConfigName ("1-foo" ),
@@ -78,7 +79,7 @@ func TestConfigList(t *testing.T) {
7879
7980func TestConfigListWithQuietOption (t * testing.T ) {
8081 cli := test .NewFakeCli (& fakeClient {
81- configListFunc : func (_ context.Context , options swarm .ConfigListOptions ) ([]swarm.Config , error ) {
82+ configListFunc : func (_ context.Context , options client .ConfigListOptions ) ([]swarm.Config , error ) {
8283 return []swarm.Config {
8384 * builders .Config (builders .ConfigID ("ID-foo" ), builders .ConfigName ("foo" )),
8485 * builders .Config (builders .ConfigID ("ID-bar" ), builders .ConfigName ("bar" ), builders .ConfigLabels (map [string ]string {
@@ -95,7 +96,7 @@ func TestConfigListWithQuietOption(t *testing.T) {
9596
9697func TestConfigListWithConfigFormat (t * testing.T ) {
9798 cli := test .NewFakeCli (& fakeClient {
98- configListFunc : func (_ context.Context , options swarm .ConfigListOptions ) ([]swarm.Config , error ) {
99+ configListFunc : func (_ context.Context , options client .ConfigListOptions ) ([]swarm.Config , error ) {
99100 return []swarm.Config {
100101 * builders .Config (builders .ConfigID ("ID-foo" ), builders .ConfigName ("foo" )),
101102 * builders .Config (builders .ConfigID ("ID-bar" ), builders .ConfigName ("bar" ), builders .ConfigLabels (map [string ]string {
@@ -114,7 +115,7 @@ func TestConfigListWithConfigFormat(t *testing.T) {
114115
115116func TestConfigListWithFormat (t * testing.T ) {
116117 cli := test .NewFakeCli (& fakeClient {
117- configListFunc : func (_ context.Context , options swarm .ConfigListOptions ) ([]swarm.Config , error ) {
118+ configListFunc : func (_ context.Context , options client .ConfigListOptions ) ([]swarm.Config , error ) {
118119 return []swarm.Config {
119120 * builders .Config (builders .ConfigID ("ID-foo" ), builders .ConfigName ("foo" )),
120121 * builders .Config (builders .ConfigID ("ID-bar" ), builders .ConfigName ("bar" ), builders .ConfigLabels (map [string ]string {
@@ -131,7 +132,7 @@ func TestConfigListWithFormat(t *testing.T) {
131132
132133func TestConfigListWithFilter (t * testing.T ) {
133134 cli := test .NewFakeCli (& fakeClient {
134- configListFunc : func (_ context.Context , options swarm .ConfigListOptions ) ([]swarm.Config , error ) {
135+ configListFunc : func (_ context.Context , options client .ConfigListOptions ) ([]swarm.Config , error ) {
135136 assert .Check (t , is .Equal ("foo" , options .Filters .Get ("name" )[0 ]))
136137 assert .Check (t , is .Equal ("lbl1=Label-bar" , options .Filters .Get ("label" )[0 ]))
137138 return []swarm.Config {
0 commit comments