Commit Graph

8608 Commits

Author SHA1 Message Date
Sebastiaan van Stijn 73624c4bde
internal/test: FakeCli: remove name for unused arg (revive)
internal/test/cli.go:184:34: unused-parameter: parameter 'insecure' seems to be unused, consider removing or renaming it as _ (revive)
    func (c *FakeCli) RegistryClient(insecure bool) registryclient.RegistryClient {
                                     ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 399ded9b98)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-15 15:25:45 +02:00
Sebastiaan van Stijn 974dcfd654
internal/test/notary: remove name for unused arg (revive)
internal/test/notary/client.go:16:33: unused-parameter: parameter 'imgRefAndAuth' seems to be unused, consider removing or renaming it as _ (revive)
    func GetOfflineNotaryRepository(imgRefAndAuth trust.ImageRefAndAuth, actions []string) (client.Repository, error) {
                                    ^
    internal/test/notary/client.go:25:45: unused-parameter: parameter 'rootKeyIDs' seems to be unused, consider removing or renaming it as _ (revive)
    func (o OfflineNotaryRepository) Initialize(rootKeyIDs []string, serverManagedRoles ...data.RoleName) error {
                                                ^
    internal/test/notary/client.go:30:60: unused-parameter: parameter 'rootKeyIDs' seems to be unused, consider removing or renaming it as _ (revive)
    func (o OfflineNotaryRepository) InitializeWithCertificate(rootKeyIDs []string, rootCerts []data.PublicKey, serverManagedRoles ...data.RoleName) error {
                                                               ^
    internal/test/notary/client.go:42:44: unused-parameter: parameter 'target' seems to be unused, consider removing or renaming it as _ (revive)
    func (o OfflineNotaryRepository) AddTarget(target *client.Target, roles ...data.RoleName) error {
                                               ^
    internal/test/notary/client.go:48:47: unused-parameter: parameter 'targetName' seems to be unused, consider removing or renaming it as _ (revive)
    func (o OfflineNotaryRepository) RemoveTarget(targetName string, roles ...data.RoleName) error {
                                                  ^
    internal/test/notary/client.go:54:46: unused-parameter: parameter 'roles' seems to be unused, consider removing or renaming it as _ (revive)
    func (o OfflineNotaryRepository) ListTargets(roles ...data.RoleName) ([]*client.TargetWithRole, error) {
                                                 ^
    internal/test/notary/client.go:59:50: unused-parameter: parameter 'name' seems to be unused, consider removing or renaming it as _ (revive)
    func (o OfflineNotaryRepository) GetTargetByName(name string, roles ...data.RoleName) (*client.TargetWithRole, error) {
                                                     ^
    internal/test/notary/client.go:65:61: unused-parameter: parameter 'name' seems to be unused, consider removing or renaming it as _ (revive)
    func (o OfflineNotaryRepository) GetAllTargetMetadataByName(name string) ([]client.TargetSignedStruct, error) {
                                                                ^
    internal/test/notary/client.go:85:48: unused-parameter: parameter 'name' seems to be unused, consider removing or renaming it as _ (revive)
    func (o OfflineNotaryRepository) AddDelegation(name data.RoleName, delegationKeys []data.PublicKey, paths []string) error {
                                                   ^
    internal/test/notary/client.go:90:59: unused-parameter: parameter 'name' seems to be unused, consider removing or renaming it as _ (revive)
    func (o OfflineNotaryRepository) AddDelegationRoleAndKeys(name data.RoleName, delegationKeys []data.PublicKey) error {
                                                              ^
    internal/test/notary/client.go:95:53: unused-parameter: parameter 'name' seems to be unused, consider removing or renaming it as _ (revive)
    func (o OfflineNotaryRepository) AddDelegationPaths(name data.RoleName, paths []string) error {
                                                        ^
    internal/test/notary/client.go💯63: unused-parameter: parameter 'name' seems to be unused, consider removing or renaming it as _ (revive)
    func (o OfflineNotaryRepository) RemoveDelegationKeysAndPaths(name data.RoleName, keyIDs, paths []string) error {
                                                                  ^
    internal/test/notary/client.go:105:55: unused-parameter: parameter 'name' seems to be unused, consider removing or renaming it as _ (revive)
    func (o OfflineNotaryRepository) RemoveDelegationRole(name data.RoleName) error {
                                                          ^
    internal/test/notary/client.go:110:56: unused-parameter: parameter 'name' seems to be unused, consider removing or renaming it as _ (revive)
    func (o OfflineNotaryRepository) RemoveDelegationPaths(name data.RoleName, paths []string) error {
                                                           ^
    internal/test/notary/client.go:115:55: unused-parameter: parameter 'name' seems to be unused, consider removing or renaming it as _ (revive)
    func (o OfflineNotaryRepository) RemoveDelegationKeys(name data.RoleName, keyIDs []string) error {
                                                          ^
    internal/test/notary/client.go:120:55: unused-parameter: parameter 'name' seems to be unused, consider removing or renaming it as _ (revive)
    func (o OfflineNotaryRepository) ClearDelegationPaths(name data.RoleName) error {
                                                          ^
    internal/test/notary/client.go:126:42: unused-parameter: parameter 'roles' seems to be unused, consider removing or renaming it as _ (revive)
    func (o OfflineNotaryRepository) Witness(roles ...data.RoleName) ([]data.RoleName, error) {
                                             ^
    internal/test/notary/client.go:131:44: unused-parameter: parameter 'role' seems to be unused, consider removing or renaming it as _ (revive)
    func (o OfflineNotaryRepository) RotateKey(role data.RoleName, serverManagesKey bool, keyList []string) error {
                                               ^
    internal/test/notary/client.go:142:52: unused-parameter: parameter 'version' seems to be unused, consider removing or renaming it as _ (revive)
    func (o OfflineNotaryRepository) SetLegacyVersions(version int) {}
                                                       ^
    internal/test/notary/client.go:150:39: unused-parameter: parameter 'imgRefAndAuth' seems to be unused, consider removing or renaming it as _ (revive)
    func GetUninitializedNotaryRepository(imgRefAndAuth trust.ImageRefAndAuth, actions []string) (client.Repository, error) {
                                          ^
    internal/test/notary/client.go:163:51: unused-parameter: parameter 'rootKeyIDs' seems to be unused, consider removing or renaming it as _ (revive)
    func (u UninitializedNotaryRepository) Initialize(rootKeyIDs []string, serverManagedRoles ...data.RoleName) error {
                                                      ^
    internal/test/notary/client.go:168:66: unused-parameter: parameter 'rootKeyIDs' seems to be unused, consider removing or renaming it as _ (revive)
    func (u UninitializedNotaryRepository) InitializeWithCertificate(rootKeyIDs []string, rootCerts []data.PublicKey, serverManagedRoles ...data.RoleName) error {
                                                                     ^
    internal/test/notary/client.go:180:52: unused-parameter: parameter 'roles' seems to be unused, consider removing or renaming it as _ (revive)
    func (u UninitializedNotaryRepository) ListTargets(roles ...data.RoleName) ([]*client.TargetWithRole, error) {
                                                       ^
    internal/test/notary/client.go:185:56: unused-parameter: parameter 'name' seems to be unused, consider removing or renaming it as _ (revive)
    func (u UninitializedNotaryRepository) GetTargetByName(name string, roles ...data.RoleName) (*client.TargetWithRole, error) {
                                                           ^
    internal/test/notary/client.go:191:67: unused-parameter: parameter 'name' seems to be unused, consider removing or renaming it as _ (revive)
    func (u UninitializedNotaryRepository) GetAllTargetMetadataByName(name string) ([]client.TargetSignedStruct, error) {
                                                                      ^
    internal/test/notary/client.go:206:50: unused-parameter: parameter 'role' seems to be unused, consider removing or renaming it as _ (revive)
    func (u UninitializedNotaryRepository) RotateKey(role data.RoleName, serverManagesKey bool, keyList []string) error {
                                                     ^
    internal/test/notary/client.go:211:38: unused-parameter: parameter 'imgRefAndAuth' seems to be unused, consider removing or renaming it as _ (revive)
    func GetEmptyTargetsNotaryRepository(imgRefAndAuth trust.ImageRefAndAuth, actions []string) (client.Repository, error) {
                                         ^
    internal/test/notary/client.go:223:50: unused-parameter: parameter 'rootKeyIDs' seems to be unused, consider removing or renaming it as _ (revive)
    func (e EmptyTargetsNotaryRepository) Initialize(rootKeyIDs []string, serverManagedRoles ...data.RoleName) error {
                                                     ^
    internal/test/notary/client.go:228:65: unused-parameter: parameter 'rootKeyIDs' seems to be unused, consider removing or renaming it as _ (revive)
    func (e EmptyTargetsNotaryRepository) InitializeWithCertificate(rootKeyIDs []string, rootCerts []data.PublicKey, serverManagedRoles ...data.RoleName) error {
                                                                    ^
    internal/test/notary/client.go:240:51: unused-parameter: parameter 'roles' seems to be unused, consider removing or renaming it as _ (revive)
    func (e EmptyTargetsNotaryRepository) ListTargets(roles ...data.RoleName) ([]*client.TargetWithRole, error) {
                                                      ^
    internal/test/notary/client.go:245:68: unused-parameter: parameter 'roles' seems to be unused, consider removing or renaming it as _ (revive)
    func (e EmptyTargetsNotaryRepository) GetTargetByName(name string, roles ...data.RoleName) (*client.TargetWithRole, error) {
                                                                       ^
    internal/test/notary/client.go:284:49: unused-parameter: parameter 'role' seems to be unused, consider removing or renaming it as _ (revive)
    func (e EmptyTargetsNotaryRepository) RotateKey(role data.RoleName, serverManagesKey bool, keyList []string) error {
                                                    ^
    internal/test/notary/client.go:289:32: unused-parameter: parameter 'imgRefAndAuth' seems to be unused, consider removing or renaming it as _ (revive)
    func GetLoadedNotaryRepository(imgRefAndAuth trust.ImageRefAndAuth, actions []string) (client.Repository, error) {
                                   ^
    internal/test/notary/client.go:509:45: unused-parameter: parameter 'imgRefAndAuth' seems to be unused, consider removing or renaming it as _ (revive)
    func GetLoadedWithNoSignersNotaryRepository(imgRefAndAuth trust.ImageRefAndAuth, actions []string) (client.Repository, error) {
                                                ^
    internal/test/notary/client.go:532:75: unused-parameter: parameter 'roles' seems to be unused, consider removing or renaming it as _ (revive)
    func (l LoadedWithNoSignersNotaryRepository) GetTargetByName(name string, roles ...data.RoleName) (*client.TargetWithRole, error) {
                                                                              ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 20a70cb530)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-15 15:25:34 +02:00
Sebastiaan van Stijn 0d34fe7fb2
cli/connhelper/commandconn: remove name for unused arg (revive)
cli/connhelper/commandconn/commandconn.go:35:10: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func New(ctx context.Context, cmd string, args ...string) (net.Conn, error) {
             ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 90380d9576)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-15 15:25:23 +02:00
Sebastiaan van Stijn 3b389dd273
cli/config/configfile: mockNativeStore: remove name for unused arg (revive)
cli/config/configfile/file_test.go:189:33: unused-parameter: parameter 'authConfig' seems to be unused, consider removing or renaming it as _ (revive)
    func (c *mockNativeStore) Store(authConfig types.AuthConfig) error {
                                    ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit dd6ede2109)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-15 15:25:13 +02:00
Sebastiaan van Stijn 28f1b586f6
cli/compose/schema: remove name for unused arg (revive)
cli/compose/schema/schema.go:20:44: unused-parameter: parameter 'input' seems to be unused, consider removing or renaming it as _ (revive)
    func (checker portsFormatChecker) IsFormat(input interface{}) bool {
                                               ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 7c8680c69b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-15 15:25:05 +02:00
Sebastiaan van Stijn dcec47bf2b
cli/compose/convert: fakeClient: remove name for unused arg (revive)
cli/compose/convert/service_test.go:599:33: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (c *fakeClient) SecretList(ctx context.Context, options types.SecretListOptions) ([]swarm.Secret, error) {
                                    ^
    cli/compose/convert/service_test.go:606:33: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (c *fakeClient) ConfigList(ctx context.Context, options types.ConfigListOptions) ([]swarm.Config, error) {
                                    ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 6355bcee66)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-15 15:24:55 +02:00
Sebastiaan van Stijn b298f8f2cd
cli/command/volume: remove name for unused arg (revive)
cli/command/volume/prune_test.go:113:22: unused-parameter: parameter 'args' seems to be unused, consider removing or renaming it as _ (revive)
    func simplePruneFunc(args filters.Args) (types.VolumesPruneReport, error) {
                         ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 607f290f65)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-15 15:24:46 +02:00
Sebastiaan van Stijn 8cbad756d9
cli/command/trust: fakeClient: remove name for unused arg (revive)
cli/command/trust/inspect_pretty_test.go:30:27: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (c *fakeClient) Info(ctx context.Context) (types.Info, error) {
                              ^
    cli/command/trust/inspect_pretty_test.go:34:42: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (c *fakeClient) ImageInspectWithRaw(ctx context.Context, imageID string) (types.ImageInspect, []byte, error) {
                                             ^
    cli/command/trust/inspect_pretty_test.go:38:32: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (c *fakeClient) ImagePush(ctx context.Context, image string, options types.ImagePushOptions) (io.ReadCloser, error) {
                                   ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 546cf6d985)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-15 15:24:36 +02:00
Sebastiaan van Stijn 93772a590d
cli/command/task: fakeClient: remove name for unused arg (revive)
cli/command/task/client_test.go:17:43: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) NodeInspectWithRaw(ctx context.Context, ref string) (swarm.Node, []byte, error) {
                                              ^
    cli/command/task/client_test.go:24:46: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) ServiceInspectWithRaw(ctx context.Context, ref string, options types.ServiceInspectOptions) (swarm.Service, []byte, error) {
                                                 ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit b32b28041d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-15 15:24:26 +02:00
Sebastiaan van Stijn fec554c357
cli/command/swarm: fakeClient: remove name for unused arg (revive)
cli/command/swarm/ipnet_slice_test.go:13:14: unused-parameter: parameter 'ip' seems to be unused, consider removing or renaming it as _ (revive)
    func getCIDR(ip net.IP, cidr *net.IPNet, err error) net.IPNet {
                 ^
    cli/command/swarm/client_test.go:24:29: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) Info(ctx context.Context) (types.Info, error) {
                                ^
    cli/command/swarm/client_test.go:31:43: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) NodeInspectWithRaw(ctx context.Context, ref string) (swarm.Node, []byte, error) {
                                              ^
    cli/command/swarm/client_test.go:38:34: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) SwarmInit(ctx context.Context, req swarm.InitRequest) (string, error) {
                                     ^
    cli/command/swarm/client_test.go:45:37: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) SwarmInspect(ctx context.Context) (swarm.Swarm, error) {
                                        ^
    cli/command/swarm/client_test.go:52:42: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) SwarmGetUnlockKey(ctx context.Context) (types.SwarmUnlockKeyResponse, error) {
                                             ^
    cli/command/swarm/client_test.go:59:34: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) SwarmJoin(ctx context.Context, req swarm.JoinRequest) error {
                                     ^
    cli/command/swarm/client_test.go:66:35: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) SwarmLeave(ctx context.Context, force bool) error {
                                      ^
    cli/command/swarm/client_test.go:73:36: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) SwarmUpdate(ctx context.Context, version swarm.Version, swarm swarm.Spec, flags swarm.UpdateFlags) error {
                                       ^
    cli/command/swarm/client_test.go:80:36: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) SwarmUnlock(ctx context.Context, req swarm.UnlockRequest) error {
                                       ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 40a51d5543)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-15 15:24:17 +02:00
Sebastiaan van Stijn be6f8b2b69
cli/command/stack: fakeClient: remove name for unused arg (revive)
cli/command/stack/swarm/client_test.go:46:38: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) ServerVersion(ctx context.Context) (types.Version, error) {
                                         ^
    cli/command/stack/swarm/client_test.go:57:36: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) ServiceList(ctx context.Context, options types.ServiceListOptions) ([]swarm.Service, error) {
                                       ^
    cli/command/stack/swarm/client_test.go:72:36: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) NetworkList(ctx context.Context, options types.NetworkListOptions) ([]types.NetworkResource, error) {
                                       ^
    cli/command/stack/swarm/client_test.go:87:35: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) SecretList(ctx context.Context, options types.SecretListOptions) ([]swarm.Secret, error) {
                                      ^
    cli/command/stack/swarm/client_test.go:102:35: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) ConfigList(ctx context.Context, options types.ConfigListOptions) ([]swarm.Config, error) {
                                      ^
    cli/command/stack/swarm/client_test.go:117:33: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) TaskList(ctx context.Context, options types.TaskListOptions) ([]swarm.Task, error) {
                                    ^
    cli/command/stack/swarm/client_test.go:124:33: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) NodeList(ctx context.Context, options types.NodeListOptions) ([]swarm.Node, error) {
                                    ^
    cli/command/stack/swarm/client_test.go:131:43: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) NodeInspectWithRaw(ctx context.Context, ref string) (swarm.Node, []byte, error) {
                                              ^
    cli/command/stack/swarm/client_test.go:138:38: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec, options types.ServiceUpdateOptions) (types.ServiceUpdateResponse, error) {
                                         ^
    cli/command/stack/swarm/client_test.go:146:38: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) ServiceRemove(ctx context.Context, serviceID string) error {
                                         ^
    cli/command/stack/swarm/client_test.go:155:38: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) NetworkRemove(ctx context.Context, networkID string) error {
                                         ^
    cli/command/stack/swarm/client_test.go:164:37: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) SecretRemove(ctx context.Context, secretID string) error {
                                        ^
    cli/command/stack/swarm/client_test.go:173:37: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) ConfigRemove(ctx context.Context, configID string) error {
                                        ^
    cli/command/stack/client_test.go:46:38: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) ServerVersion(ctx context.Context) (types.Version, error) {
                                         ^
    cli/command/stack/client_test.go:57:36: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) ServiceList(ctx context.Context, options types.ServiceListOptions) ([]swarm.Service, error) {
                                       ^
    cli/command/stack/client_test.go:72:36: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) NetworkList(ctx context.Context, options types.NetworkListOptions) ([]types.NetworkResource, error) {
                                       ^
    cli/command/stack/client_test.go:87:35: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) SecretList(ctx context.Context, options types.SecretListOptions) ([]swarm.Secret, error) {
                                      ^
    cli/command/stack/client_test.go:102:35: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) ConfigList(ctx context.Context, options types.ConfigListOptions) ([]swarm.Config, error) {
                                      ^
    cli/command/stack/client_test.go:117:33: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) TaskList(ctx context.Context, options types.TaskListOptions) ([]swarm.Task, error) {
                                    ^
    cli/command/stack/client_test.go:124:33: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) NodeList(ctx context.Context, options types.NodeListOptions) ([]swarm.Node, error) {
                                    ^
    cli/command/stack/client_test.go:131:43: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) NodeInspectWithRaw(ctx context.Context, ref string) (swarm.Node, []byte, error) {
                                              ^
    cli/command/stack/client_test.go:138:38: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec, options types.ServiceUpdateOptions) (types.ServiceUpdateResponse, error) {
                                         ^
    cli/command/stack/client_test.go:146:38: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) ServiceRemove(ctx context.Context, serviceID string) error {
                                         ^
    cli/command/stack/client_test.go:155:38: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) NetworkRemove(ctx context.Context, networkID string) error {
                                         ^
    cli/command/stack/client_test.go:164:37: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) SecretRemove(ctx context.Context, secretID string) error {
                                        ^
    cli/command/stack/client_test.go:173:37: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) ConfigRemove(ctx context.Context, configID string) error {
                                        ^
    cli/command/stack/client_test.go:182:46: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) ServiceInspectWithRaw(ctx context.Context, serviceID string, opts types.ServiceInspectOptions) (swarm.Service, []byte, error) {
                                                 ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit b0d0b0efcb)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-15 15:24:07 +02:00
Sebastiaan van Stijn 67474fb865
cli/command/service: fakeClient: remove name for unused arg (revive)
cli/command/service/update_test.go:507:41: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (s secretAPIClientMock) SecretList(ctx context.Context, options types.SecretListOptions) ([]swarm.Secret, error) {
                                            ^
    cli/command/service/update_test.go:511:43: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (s secretAPIClientMock) SecretCreate(ctx context.Context, secret swarm.SecretSpec) (types.SecretCreateResponse, error) {
                                              ^
    cli/command/service/update_test.go:515:43: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (s secretAPIClientMock) SecretRemove(ctx context.Context, id string) error {
                                              ^
    cli/command/service/update_test.go:519:51: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (s secretAPIClientMock) SecretInspectWithRaw(ctx context.Context, name string) (swarm.Secret, []byte, error) {
                                                      ^
    cli/command/service/update_test.go:523:43: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (s secretAPIClientMock) SecretUpdate(ctx context.Context, id string, version swarm.Version, secret swarm.SecretSpec) error {
                                              ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit c69640d8c1)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-15 15:23:56 +02:00
Sebastiaan van Stijn 5840a39af4
cli/command/registry: fakeClient: remove name for unused arg (revive)
cli/command/registry/login_test.go:37:26: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (c fakeClient) Info(ctx context.Context) (types.Info, error) {
                             ^
    cli/command/registry/login_test.go:41:35: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (c fakeClient) RegistryLogin(ctx context.Context, auth types.AuthConfig) (registrytypes.AuthenticateOKBody, error) {
                                      ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 5254081fd6)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-15 15:23:45 +02:00
Sebastiaan van Stijn e2949a1333
cli/command/plugin: fakeClient: remove name for unused arg (revive)
cli/command/plugin/client_test.go:23:35: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (c *fakeClient) PluginCreate(ctx context.Context, createContext io.Reader, createOptions types.PluginCreateOptions) error {
                                      ^
    cli/command/plugin/client_test.go:30:35: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (c *fakeClient) PluginEnable(ctx context.Context, name string, enableOptions types.PluginEnableOptions) error {
                                      ^
    cli/command/plugin/client_test.go:37:36: unused-parameter: parameter 'context' seems to be unused, consider removing or renaming it as _ (revive)
    func (c *fakeClient) PluginDisable(context context.Context, name string, disableOptions types.PluginDisableOptions) error {
                                       ^
    cli/command/plugin/client_test.go:44:35: unused-parameter: parameter 'context' seems to be unused, consider removing or renaming it as _ (revive)
    func (c *fakeClient) PluginRemove(context context.Context, name string, removeOptions types.PluginRemoveOptions) error {
                                      ^
    cli/command/plugin/client_test.go:51:36: unused-parameter: parameter 'context' seems to be unused, consider removing or renaming it as _ (revive)
    func (c *fakeClient) PluginInstall(context context.Context, name string, installOptions types.PluginInstallOptions) (io.ReadCloser, error) {
                                       ^
    cli/command/plugin/client_test.go:58:33: unused-parameter: parameter 'context' seems to be unused, consider removing or renaming it as _ (revive)
    func (c *fakeClient) PluginList(context context.Context, filter filters.Args) (types.PluginsListResponse, error) {
                                    ^
    cli/command/plugin/client_test.go:66:43: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (c *fakeClient) PluginInspectWithRaw(ctx context.Context, name string) (*types.Plugin, []byte, error) {
                                              ^
    cli/command/plugin/client_test.go:74:27: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (c *fakeClient) Info(ctx context.Context) (types.Info, error) {
                              ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit da3416c023)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-15 15:23:34 +02:00
Sebastiaan van Stijn e7f258feaf
cli/command/node: fakeClient: remove name for unused arg (revive)
cli/command/node/client_test.go:23:43: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) NodeInspectWithRaw(ctx context.Context, ref string) (swarm.Node, []byte, error) {
                                              ^
    cli/command/node/client_test.go:30:33: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) NodeList(ctx context.Context, options types.NodeListOptions) ([]swarm.Node, error) {
                                    ^
    cli/command/node/client_test.go:37:35: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) NodeRemove(ctx context.Context, nodeID string, options types.NodeRemoveOptions) error {
                                      ^
    cli/command/node/client_test.go:44:35: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) NodeUpdate(ctx context.Context, nodeID string, version swarm.Version, node swarm.NodeSpec) error {
                                      ^
    cli/command/node/client_test.go:51:29: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) Info(ctx context.Context) (types.Info, error) {
                                ^
    cli/command/node/client_test.go:58:43: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) TaskInspectWithRaw(ctx context.Context, taskID string) (swarm.Task, []byte, error) {
                                              ^
    cli/command/node/client_test.go:65:33: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) TaskList(ctx context.Context, options types.TaskListOptions) ([]swarm.Task, error) {
                                    ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 625988c3aa)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-15 15:23:22 +02:00
Sebastiaan van Stijn 9835110f8b
cli/command/network: fakeClient: remove name for unused arg (revive)
cli/command/network/client_test.go:55:44: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (c *fakeClient) NetworkInspectWithRaw(ctx context.Context, network string, options types.NetworkInspectOptions) (types.NetworkResource, []byte, error) {
                                               ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 92d9e3bf69)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-15 15:23:09 +02:00
Sebastiaan van Stijn cb6a1dfe6f
cli/command/image: fakeClient: remove name for unused arg (revive)
cli/command/image/client_test.go:90:34: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) ImageList(ctx context.Context, options types.ImageListOptions) ([]types.ImageSummary, error) {
                                     ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 316c4992c4)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-15 15:23:00 +02:00
Sebastiaan van Stijn 3eee043fec
cli/command/image/build: remove name for unused arg (revive)
cli/command/image/build/context_test.go:21:19: unused-parameter: parameter 't' seems to be unused, consider removing or renaming it as _ (revive)
    func prepareEmpty(t *testing.T) string {
                      ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit ae5a86bb8d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-15 15:22:51 +02:00
Sebastiaan van Stijn d07bce7fd2
cli/command/idresolver: fakeClient: remove name for unused arg (revive)
cli/command/idresolver/client_test.go:17:43: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) NodeInspectWithRaw(ctx context.Context, nodeID string) (swarm.Node, []byte, error) {
                                              ^
    cli/command/idresolver/client_test.go:24:46: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) ServiceInspectWithRaw(ctx context.Context, serviceID string, options types.ServiceInspectOptions) (swarm.Service, []byte, error) {
                                                 ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 38ef40ee7a)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-15 15:22:31 +02:00
Sebastiaan van Stijn 63e163cf3c
cli/command/container: fakeClient: remove name for unused arg (revive)
cli/command/container/client_test.go:67:41: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (f *fakeClient) ContainerExecStart(ctx context.Context, execID string, config types.ExecStartCheck) error {
                                            ^
    cli/command/container/client_test.go:92:34: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (f *fakeClient) ImageCreate(ctx context.Context, parentReference string, options types.ImageCreateOptions) (io.ReadCloser, error) {
                                     ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 45b5676acd)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-15 15:22:21 +02:00
Sebastiaan van Stijn 42e07e50fb
cli/command/checkpoint: fakeClient: remove name for unused arg (revive)
cli/command/checkpoint/client_test.go:17:41: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) CheckpointCreate(ctx context.Context, container string, options types.CheckpointCreateOptions) error {
                                            ^
    cli/command/checkpoint/client_test.go:24:41: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) CheckpointDelete(ctx context.Context, container string, options types.CheckpointDeleteOptions) error {
                                            ^
    cli/command/checkpoint/client_test.go:31:39: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (cli *fakeClient) CheckpointList(ctx context.Context, container string, options types.CheckpointListOptions) ([]types.Checkpoint, error) {
                                          ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 5563c5a91d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-15 15:22:12 +02:00
Sebastiaan van Stijn 6ef0757c0e
cli/command/secret: fakeClient: include context in fake client (revive)
I could either remove the name for these contexts, or make the fake functions
more accurately reflect the actual implementation (decided to go for the latter
one)

    cli/command/secret/client_test.go:19:35: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (c *fakeClient) SecretCreate(ctx context.Context, spec swarm.SecretSpec) (types.SecretCreateResponse, error) {
                                      ^
    cli/command/secret/client_test.go:26:43: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (c *fakeClient) SecretInspectWithRaw(ctx context.Context, id string) (swarm.Secret, []byte, error) {
                                              ^
    cli/command/secret/client_test.go:33:33: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (c *fakeClient) SecretList(ctx context.Context, options types.SecretListOptions) ([]swarm.Secret, error) {
                                    ^
    cli/command/secret/client_test.go:40:35: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (c *fakeClient) SecretRemove(ctx context.Context, name string) error {
                                      ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 9dd012aa5d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-15 15:21:58 +02:00
Sebastiaan van Stijn d741c64884
cli/command/config: fakeClient: include context in fake client (revive)
I could either remove the name for these contexts, or make the fake functions
more accurately reflect the actual implementation (decided to go for the latter
one)

.   cli/command/config/client_test.go:19:35: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (c *fakeClient) ConfigCreate(ctx context.Context, spec swarm.ConfigSpec) (types.ConfigCreateResponse, error) {
                                      ^
    cli/command/config/client_test.go:26:43: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (c *fakeClient) ConfigInspectWithRaw(ctx context.Context, id string) (swarm.Config, []byte, error) {
                                              ^
    cli/command/config/client_test.go:33:33: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (c *fakeClient) ConfigList(ctx context.Context, options types.ConfigListOptions) ([]swarm.Config, error) {
                                    ^
    cli/command/config/client_test.go:40:35: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (c *fakeClient) ConfigRemove(ctx context.Context, name string) error {
                                      ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 66c66bdce7)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-15 15:21:48 +02:00
Sebastiaan van Stijn dccbbfc4c7
internal/test/network: FakeClient: embed interface to remove boilerplating
Only a single method of the FakeClient was actually implemented (and used).
This patch embeds the interface it must implement to reduce the boilerplating
for not yet implemented methods.

Calling any of the unimplemented methods will result in a panic, which will
make it clear when they must be implemented :)

This also fixes various linting errors;

    internal/test/network/client.go:17:37: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (c *FakeClient) NetworkConnect(ctx context.Context, networkID, container string, config *network.EndpointSettings) error {
                                        ^
    internal/test/network/client.go:22:65: unused-parameter: parameter 'options' seems to be unused, consider removing or renaming it as _ (revive)
    func (c *FakeClient) NetworkCreate(_ context.Context, _ string, options types.NetworkCreate) (types.NetworkCreateResponse, error) {
                                                                    ^
    internal/test/network/client.go:27:40: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (c *FakeClient) NetworkDisconnect(ctx context.Context, networkID, container string, force bool) error {
                                           ^
    internal/test/network/client.go:45:53: unused-parameter: parameter 'options' seems to be unused, consider removing or renaming it as _ (revive)
    func (c *FakeClient) NetworkList(_ context.Context, options types.NetworkListOptions) ([]types.NetworkResource, error) {
                                                        ^
    internal/test/network/client.go:50:36: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
    func (c *FakeClient) NetworkRemove(ctx context.Context, networkID string) error {
                                       ^
    internal/test/network/client.go:55:55: unused-parameter: parameter 'pruneFilter' seems to be unused, consider removing or renaming it as _ (revive)
    func (c *FakeClient) NetworksPrune(_ context.Context, pruneFilter filters.Args) (types.NetworksPruneReport, error) {
                                                          ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit ac024a4d8b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-15 15:21:37 +02:00
Sebastiaan van Stijn c0581e8a38
cli/trust: remove name for unused args (revive)
These method must implements an interface, but don't use the argument.

    cli/trust/trust.go:85:40: unused-parameter: parameter 'u' seems to be unused, consider removing or renaming it as _ (revive)
    func (scs simpleCredentialStore) Basic(u *url.URL) (string, string) {
                                           ^
    cli/trust/trust.go:89:47: unused-parameter: parameter 'u' seems to be unused, consider removing or renaming it as _ (revive)
    func (scs simpleCredentialStore) RefreshToken(u *url.URL, service string) string {
                                                  ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit a2d532819d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-15 15:21:26 +02:00
Sebastiaan van Stijn 0cfc19830b
opts: NormalizeCapability(): fix redefinition of the built-in function (revive)
opts/capabilities.go:25:2: redefines-builtin-id: redefinition of the built-in function cap (revive)
        cap = strings.ToUpper(strings.TrimSpace(cap))
        ^
    opts/capabilities.go:30:3: redefines-builtin-id: redefinition of the built-in function cap (revive)
            cap = "CAP_" + cap
            ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit f5fad186c0)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-15 15:21:17 +02:00
Sebastiaan van Stijn ae7cd7e16a
cli/registry/client: AuthorizeRequest(): remove name for unused arg (revive)
This method implements the interface defined in distribution, but doesn't
use the argument.

    cli/registry/client/endpoint.go:123:69: unused-parameter: parameter 'params' seems to be unused, consider removing or renaming it as _ (revive)
    func (th *existingTokenHandler) AuthorizeRequest(req *http.Request, params map[string]string) error {
                                                                        ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 9252fae838)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-15 15:21:09 +02:00
Sebastiaan van Stijn 9e8d522f77
cli/command/service/progress: remove name for unused parameter (revive)
This function must match the interface, but doesn't use the firs argument.

    cli/command/service/progress/progress.go:417:40: unused-parameter: parameter 'service' seems to be unused, consider removing or renaming it as _ (revive)
    func (u *globalProgressUpdater) update(service swarm.Service, tasks []swarm.Task, activeNodes map[string]struct{}, rollback bool) (bool, error) {
                                           ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 92506afd49)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-15 15:21:00 +02:00
Sebastiaan van Stijn 3882e674e4
cli/command: RunPrune(): remove name for unused "all" parameter (revive)
These functions must have the same signature, but only some of them accept
an "all" boolean argument;
88924b1802/cli/command/system/prune.go (L79)

    cli/command/container/prune.go:78:38: unused-parameter: parameter 'all' seems to be unused, consider removing or renaming it as _ (revive)
    func RunPrune(dockerCli command.Cli, all bool, filter opts.FilterOpt) (uint64, string, error) {
                                         ^
    cli/command/network/prune.go:73:38: unused-parameter: parameter 'all' seems to be unused, consider removing or renaming it as _ (revive)
    func RunPrune(dockerCli command.Cli, all bool, filter opts.FilterOpt) (uint64, string, error) {
                                         ^
    cli/command/volume/prune.go:78:38: unused-parameter: parameter 'all' seems to be unused, consider removing or renaming it as _ (revive)
    func RunPrune(dockerCli command.Cli, all bool, filter opts.FilterOpt) (uint64, string, error) {
                                         ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit c3d7f167bd)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-15 15:20:50 +02:00
Sebastiaan van Stijn 10483a1bfe
cli/command/completion: NoComplete(): remove unused argument (revive)
cli/command/completion/functions.go:97:17: unused-parameter: parameter 'cmd' seems to be unused, consider removing or renaming it as _ (revive)
    func NoComplete(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
                    ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit b4aff3a14d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-15 15:20:41 +02:00
Sebastiaan van Stijn de94fd5ecf
cli/command/stack: deprecate now obsolete wrappers
These wrappers were added to abstract stack deploy to k8s and swarm. Now
that support for deploying to k8s was removed, we can remove these wrappers.

This deprecates:

- RunDeploy()
- RunPs()
- RunRemove()
- GetServices()

This also addresses some linting failers, due to these functions having
unused arguments:

    cli/command/stack/deploy.go:51:39: unused-parameter: parameter 'flags' seems to be unused, consider removing or renaming it as _ (revive)
    func RunDeploy(dockerCli command.Cli, flags *pflag.FlagSet, config *composetypes.Config, opts options.Deploy) error {
                                              ^
    cli/command/stack/ps.go:42:35: unused-parameter: parameter 'flags' seems to be unused, consider removing or renaming it as _ (revive)
    func RunPs(dockerCli command.Cli, flags *pflag.FlagSet, opts options.PS) error {
                                      ^
    cli/command/stack/remove.go:35:39: unused-parameter: parameter 'flags' seems to be unused, consider removing or renaming it as _ (revive)
    func RunRemove(dockerCli command.Cli, flags *pflag.FlagSet, opts options.Remove) error {
                                          ^
    cli/command/stack/list.go:37:14: unused-parameter: parameter 'cmd' seems to be unused, consider removing or renaming it as _ (revive)
    func RunList(cmd *cobra.Command, dockerCli command.Cli, opts options.List) error {
                 ^
    cli/command/stack/services.go:56:41: unused-parameter: parameter 'flags' seems to be unused, consider removing or renaming it as _ (revive)
    func GetServices(dockerCli command.Cli, flags *pflag.FlagSet, opts options.Services) ([]swarmtypes.Service, error) {
                                            ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit f08252c10a)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-15 15:20:30 +02:00
Sebastiaan van Stijn 9cc20a29ce
cli/command/context: remove redundant if ...; err != nil check (revive)
cli/command/context/create.go:121:2: if-return: redundant if ...; err != nil check, just return error instead. (revive)
        if err := s.ResetTLSMaterial(o.Name, &contextTLSData); err != nil {
            return err
        }

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 78c474539b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-15 15:20:17 +02:00
Sebastiaan van Stijn c092f42b29
cli/command/container: fix redefinition of the built-in function close (revive)
cli/command/container/run.go:176:3: redefines-builtin-id: redefinition of the built-in function close (revive)
            close, err := attachContainer(ctx, dockerCli, &errCh, config, createResponse.ID)
            ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit be97731f1a)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-15 15:20:07 +02:00
Bjorn Neergaard d652eeefee
Merge pull request #4409 from thaJeztah/23.0_update_engine
[23.0] vendor: github.com/docker/docker v23.0.6
2023-07-10 22:06:31 -06:00
Sebastiaan van Stijn f7146743f7
vendor: github.com/docker/docker v23.0.6
no changes in vendored files

full diff: https://github.com/docker/docker/compare/v23.0.5...v23.0.6

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-10 10:16:05 +02:00
Sebastiaan van Stijn 19a4a3ade2
vendor: github.com/containerd/containerd v1.6.21
no changes in vendored files

full diff: https://github.com/containerd/containerd/compare/v1.6.20...v1.6.21

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 0428418d6b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-10 10:13:45 +02:00
Sebastiaan van Stijn ca26349ad1
vendor: github.com/opencontainers/runc v1.1.7
full diff: https://github.com/opencontainers/runc/compare/v1.1.6...v1.1.7

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 05bf6fff2e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-10 10:10:47 +02:00
Sebastiaan van Stijn 49d789f800
vendor: github.com/opencontainers/runc v1.1.6
full diff: https://github.com/opencontainers/runc/compare/v1.1.5...v1.1.6

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 0286e36bbe)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-10 10:10:47 +02:00
Sebastiaan van Stijn 865d9bce65
vendor: golang.org/x/net v0.8.0
full diff: https://github.com/golang/net/compare/v0.7.0...v0.8.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 1f1a6c5a82)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-10 10:10:43 +02:00
Sebastiaan van Stijn 01c822f924
vendor: golang.org/x/text v0.8.0
full diff: https://github.com/golang/text/compare/v0.7.0...v0.8.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 6e2163a712)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-10 10:10:32 +02:00
Sebastiaan van Stijn 42f0a62edc
vendor: golang.org/x/term v0.6.0
full diff: https://github.com/golang/term/compare/v0.5.0...v0.6.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 551d519b57)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-10 10:10:22 +02:00
Sebastiaan van Stijn 7a54b7bea2
vendor: golang.org/x/sys v0.6.0
full diff: https://github.com/golang/sys/compare/v0.5.0..v0.6.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 149d289638)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-10 10:09:52 +02:00
Sebastiaan van Stijn 551ac7493d
vendor: github.com/containerd/containerd v1.6.20
full diff: https://github.com/containerd/containerd/compare/v1.6.19...v1.6.20

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit a36a54d3ca)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-10 09:58:48 +02:00
Sebastiaan van Stijn 60933212ff
vendor: github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b
full diff: 02efb9a75e...3a7f492d3f

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit f4b22fb6cf)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-10 09:56:51 +02:00
Sebastiaan van Stijn def48b36de
Merge pull request #4364 from thaJeztah/23.0_update_g01.19.10
[23.0] update go to go1.19.10, alpine 3.17
2023-06-21 10:50:45 +02:00
Sebastiaan van Stijn a483dfd10b
[23.0] update go to go1.19.10
go1.19.10 (released 2023-06-06) includes four security fixes to the cmd/go and
runtime packages, as well as bug fixes to the compiler, the go command, and the
runtime. See the Go 1.19.10 milestone on our issue tracker for details:

https://github.com/golang/go/issues?q=milestone%3AGo1.19.10+label%3ACherryPickApproved

full diff: https://github.com/golang/go/compare/go1.19.9...go1.19.10

These minor releases include 3 security fixes following the security policy:

- cmd/go: cgo code injection
  The go command may generate unexpected code at build time when using cgo. This
  may result in unexpected behavior when running a go program which uses cgo.

  This may occur when running an untrusted module which contains directories with
  newline characters in their names. Modules which are retrieved using the go command,
  i.e. via "go get", are not affected (modules retrieved using GOPATH-mode, i.e.
  GO111MODULE=off, may be affected).

  Thanks to Juho Nurminen of Mattermost for reporting this issue.

  This is CVE-2023-29402 and Go issue https://go.dev/issue/60167.

- runtime: unexpected behavior of setuid/setgid binaries

  The Go runtime didn't act any differently when a binary had the setuid/setgid
  bit set. On Unix platforms, if a setuid/setgid binary was executed with standard
  I/O file descriptors closed, opening any files could result in unexpected
  content being read/written with elevated prilieges. Similarly if a setuid/setgid
  program was terminated, either via panic or signal, it could leak the contents
  of its registers.

  Thanks to Vincent Dehors from Synacktiv for reporting this issue.

  This is CVE-2023-29403 and Go issue https://go.dev/issue/60272.

- cmd/go: improper sanitization of LDFLAGS

  The go command may execute arbitrary code at build time when using cgo. This may
  occur when running "go get" on a malicious module, or when running any other
  command which builds untrusted code. This is can by triggered by linker flags,
  specified via a "#cgo LDFLAGS" directive.

  Thanks to Juho Nurminen of Mattermost for reporting this issue.

  This is CVE-2023-29404 and CVE-2023-29405 and Go issues https://go.dev/issue/60305 and https://go.dev/issue/60306.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-06-21 00:57:59 +02:00
Sebastiaan van Stijn dd7238df1e
Dockerfile: update ALPINE_VERSION to 3.17
Official Golang images are now only available for 3.18 and 3.17;
3.18 doesn't look to play well with gotestsum, so sticking to
an older version.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit acb248f8d5)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-06-21 00:57:27 +02:00
Sebastiaan van Stijn 5df4fd8b46
Merge pull request #4329 from thaJeztah/23.0_backport_dockerfile_goproxy
[23.0 backport] Dockerfile.vendor: update GOPROXY to use default with fallback
2023-06-02 14:08:35 +02:00
Sebastiaan van Stijn e7f7256b25
Dockerfile.vendor: update GOPROXY to use default with fallback
Use the default proxy, to assist with vanity domains mis-behaving, but keep
a fallback for situations where we need to get modules from GitHub directly.

This should hopefully help with the gopkg.in/yaml.v2 domain often going AWOL;

    #14 245.9 	gopkg.in/yaml.v2@v2.4.0: unrecognized import path "gopkg.in/yaml.v2": reading https://gopkg.in/yaml.v2?go-get=1: 502 Bad Gateway
    #14 245.9 	server response: Cannot obtain refs from GitHub: cannot talk to GitHub: Get https://github.com/go-yaml/yaml.git/info/refs?service=git-upload-pack: write tcp 10.131.9.188:60820->140.82.121.3:443: write: broken pipe

    curl 'https://gopkg.in/yaml.v2?go-get=1'
    Cannot obtain refs from GitHub: cannot talk to GitHub: Get https://github.com/go-yaml/yaml.git/info/refs?service=git-upload-pack: write tcp 10.131.9.188:60820->140.82.121.3:443: write: broken pipe

From the Go documentation; https://go.dev/ref/mod#goproxy-protocol

> List elements may be separated by commas (,) or pipes (|), which determine error
> fallback behavior. When a URL is followed by a comma, the go command falls back
> to later sources only after a 404 (Not Found) or 410 (Gone) response. When a URL
> is followed by a pipe, the go command falls back to later sources after any error,
> including non-HTTP errors such as timeouts. This error handling behavior lets a
> proxy act as a gatekeeper for unknown modules. For example, a proxy could respond
> with error 403 (Forbidden) for modules not on an approved list (see Private proxy
> serving private modules).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 6458dcbe51)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-06-02 13:16:32 +02:00
Sebastiaan van Stijn 90c59dcdf4
Merge pull request #4311 from thaJeztah/23.0_backport_fix_daemon_proxy 2023-05-19 17:51:21 +02:00