Files
docker-cli/e2e/cli-plugins/plugins/badmeta/main.go
Ian Campbell 5db336798c Add some simple e2e tests for executing CLI plugins
To help with this add a bad plugin which produces invalid metadata and arrange
for it to be built in the e2e container.

Signed-off-by: Ian Campbell <ijc@docker.com>
2019-01-30 13:44:05 +00:00

20 lines
359 B
Go

package main
// This is not a real plugin, but just returns malformated metadata
// from the subcommand and otherwise exits with failure.
import (
"fmt"
"os"
"github.com/docker/cli/cli-plugins/manager"
)
func main() {
if len(os.Args) == 2 && os.Args[1] == manager.MetadataSubcommandName {
fmt.Println(`{invalid-json}`)
os.Exit(0)
}
os.Exit(1)
}