mirror of
https://github.com/docker/cli.git
synced 2026-11-06 13:10:41 -04:00
cli-plugins/metadata: Add Features for optional plugin contracts
Plugins had no generic way to declare support for optional CLI contracts, so each one would need its own top-level metadata field. Add Features, keyed by feature name. Values are arbitrary JSON so a feature can carry more than a boolean. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
|
||||
//go:build go1.26
|
||||
|
||||
package metadata
|
||||
|
||||
const (
|
||||
@@ -35,4 +38,7 @@ type Metadata struct {
|
||||
URL string `json:",omitempty"`
|
||||
// Hidden hides the plugin in completion and help message output.
|
||||
Hidden bool `json:",omitempty"`
|
||||
// Features declares optional contracts supported by the plugin, keyed by
|
||||
// feature name.
|
||||
Features map[string]any `json:",omitempty"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user