From d54c7f9e63a05559d5498091d277bda3600c8e50 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 1 Sep 2025 17:32:23 +0200 Subject: [PATCH 1/2] cli-plugins/manager: remove deprecated IsNotFound These errors satisfy errdefs.IsNotFound, which can be used instead. This function was deprecated in 71460215d3f41ae449bbd5e32618fc33b638159e and is no longer used. Signed-off-by: Sebastiaan van Stijn --- cli-plugins/manager/manager.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/cli-plugins/manager/manager.go b/cli-plugins/manager/manager.go index bab031811..93adb6ff0 100644 --- a/cli-plugins/manager/manager.go +++ b/cli-plugins/manager/manager.go @@ -37,13 +37,6 @@ func (e errPluginNotFound) Error() string { return "Error: No such CLI plugin: " + string(e) } -// IsNotFound is true if the given error is due to a plugin not being found. -// -// Deprecated: use [errdefs.IsNotFound]. -func IsNotFound(err error) bool { - return errdefs.IsNotFound(err) -} - // getPluginDirs returns the platform-specific locations to search for plugins // in order of preference. // From ce72a5c28b6c26e708da03361abcd665bcb22dd3 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 2 Sep 2025 11:43:32 +0200 Subject: [PATCH 2/2] cli-plugins/manager: remove deprecated metadata aliases These consts and types were moved to a separate metadata package in commits 292713c887b17339106e9f7f3647ed50b and 4321293972a4ed804e8c063868cc5da61, and deprecated in 72f76f2720e5a31918f991ee797bfc304, 5876b2941c8b0cbefade16d6f857f1899, and 6fa7d183204046300b972ee4cb8a121e1777. This removes the deprecated aliases in `cli-plugins/manager` in favor of their equivalent in `cli-plugins/manager/metadata`: - `CommandAnnotationPlugin` - `CommandAnnotationPluginVendor` - `CommandAnnotationPluginVersion` - `CommandAnnotationPluginInvalid` - `CommandAnnotationPluginCommandPath` - `NamePrefix` - `MetadataSubcommandName` - `HookSubcommandName` - `Metadata` - `ReexecEnvvar` Signed-off-by: Sebastiaan van Stijn --- cli-plugins/manager/annotations.go | 40 ------------------------------ cli-plugins/manager/manager.go | 10 -------- cli-plugins/manager/metadata.go | 31 ----------------------- 3 files changed, 81 deletions(-) delete mode 100644 cli-plugins/manager/annotations.go delete mode 100644 cli-plugins/manager/metadata.go diff --git a/cli-plugins/manager/annotations.go b/cli-plugins/manager/annotations.go deleted file mode 100644 index abe47fe09..000000000 --- a/cli-plugins/manager/annotations.go +++ /dev/null @@ -1,40 +0,0 @@ -package manager - -import "github.com/docker/cli/cli-plugins/metadata" - -const ( - // CommandAnnotationPlugin is added to every stub command added by - // AddPluginCommandStubs with the value "true" and so can be - // used to distinguish plugin stubs from regular commands. - // - // Deprecated: use [metadata.CommandAnnotationPlugin]. This alias will be removed in the next release. - CommandAnnotationPlugin = metadata.CommandAnnotationPlugin - - // CommandAnnotationPluginVendor is added to every stub command - // added by AddPluginCommandStubs and contains the vendor of - // that plugin. - // - // Deprecated: use [metadata.CommandAnnotationPluginVendor]. This alias will be removed in the next release. - CommandAnnotationPluginVendor = metadata.CommandAnnotationPluginVendor - - // CommandAnnotationPluginVersion is added to every stub command - // added by AddPluginCommandStubs and contains the version of - // that plugin. - // - // Deprecated: use [metadata.CommandAnnotationPluginVersion]. This alias will be removed in the next release. - CommandAnnotationPluginVersion = metadata.CommandAnnotationPluginVersion - - // CommandAnnotationPluginInvalid is added to any stub command - // added by AddPluginCommandStubs for an invalid command (that - // is, one which failed it's candidate test) and contains the - // reason for the failure. - // - // Deprecated: use [metadata.CommandAnnotationPluginInvalid]. This alias will be removed in the next release. - CommandAnnotationPluginInvalid = metadata.CommandAnnotationPluginInvalid - - // CommandAnnotationPluginCommandPath is added to overwrite the - // command path for a plugin invocation. - // - // Deprecated: use [metadata.CommandAnnotationPluginCommandPath]. This alias will be removed in the next release. - CommandAnnotationPluginCommandPath = metadata.CommandAnnotationPluginCommandPath -) diff --git a/cli-plugins/manager/manager.go b/cli-plugins/manager/manager.go index 93adb6ff0..6bb047f17 100644 --- a/cli-plugins/manager/manager.go +++ b/cli-plugins/manager/manager.go @@ -18,16 +18,6 @@ import ( "golang.org/x/sync/errgroup" ) -const ( - // ReexecEnvvar is the name of an ennvar which is set to the command - // used to originally invoke the docker CLI when executing a - // plugin. Assuming $PATH and $CWD remain unchanged this should allow - // the plugin to re-execute the original CLI. - // - // Deprecated: use [metadata.ReexecEnvvar]. This alias will be removed in the next release. - ReexecEnvvar = metadata.ReexecEnvvar -) - // errPluginNotFound is the error returned when a plugin could not be found. type errPluginNotFound string diff --git a/cli-plugins/manager/metadata.go b/cli-plugins/manager/metadata.go deleted file mode 100644 index 6fda7fa1a..000000000 --- a/cli-plugins/manager/metadata.go +++ /dev/null @@ -1,31 +0,0 @@ -package manager - -import ( - "github.com/docker/cli/cli-plugins/metadata" -) - -const ( - // NamePrefix is the prefix required on all plugin binary names - // - // Deprecated: use [metadata.NamePrefix]. This alias will be removed in a future release. - NamePrefix = metadata.NamePrefix - - // MetadataSubcommandName is the name of the plugin subcommand - // which must be supported by every plugin and returns the - // plugin metadata. - // - // Deprecated: use [metadata.MetadataSubcommandName]. This alias will be removed in a future release. - MetadataSubcommandName = metadata.MetadataSubcommandName - - // HookSubcommandName is the name of the plugin subcommand - // which must be implemented by plugins declaring support - // for hooks in their metadata. - // - // Deprecated: use [metadata.HookSubcommandName]. This alias will be removed in a future release. - HookSubcommandName = metadata.HookSubcommandName -) - -// Metadata provided by the plugin. -// -// Deprecated: use [metadata.Metadata]. This alias will be removed in a future release. -type Metadata = metadata.Metadata