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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Only show progress updates after a time threshold has elapsed in order
to reduce the number of writes to the terminal.
This improves readability of the progress.
Also moves cursor show/hide into the progress printer to reduce chances
if messing up the user's terminal in case of cancellation.
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Edited second paragraph under ### Daemon configuration file to change "regardless their value" to "regardless of their value"
Signed-off-by: Jake Stokes <contactjake@developerjake.com>
- Instead of rewriting the entire line every time only clear and write
the parts that changed.
- Hide the cursor while writing progress
Both these things make the progress updates significantly easier to
read.
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This fixes a case where a non-tty will have control characters + the log
line for every single read operation.
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
We are currently loading plugin command stubs for every
invocation which still has a significant performance hit.
With this change we are doing this operation only if cobra
completion arg request is found.
- 20.10.23: `docker --version` takes ~15ms
- 23.0.1: `docker --version` takes ~93ms
With this change `docker --version` takes ~9ms
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
We are currently loading plugin commands stubs for every
command invocation to add support for Cobra v2 completion.
This cause a significant performance hit if there is a
lot of plugins in the user space (7 atm in Docker Desktop):
`docker --version` takes in current 23.0.1 ~93ms
Instead of removing completion for plugins to fix the
regression, we can slightly improve plugins discovery by
spawning a goroutine for each iteration in the loop when
listing plugins:
`docker --version` now takes ~38ms
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>