docker / docker/cli

Running an experimental plugin with non experimental CLI should show a friendly message

Open
#1,957 1 comment 0 reactions 1 assignee View on GitHub

@tiborvass is already working on this.

Since Jun 21, 2019.

area/plugins area/ux
Dominant language
Go
Stars
6.1k
Forks
2.2k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

Description
Running an experimental plugin with non experimental CLI should show a friendly message.
The code seams to be here already, but something is short-circuiting it.

Steps to reproduce the issue:

Wrote some e2e tests in e2e/cli-plugins/run_test.go:

// TestPluginExperimentalWithNonExperimentalCLI tests when the plugin is labelled as experimental but
// not the CLI, which should print a message asking the user to activate experimental mode.
func TestPluginExperimentalWithNonExperimentalCLI(t *testing.T) {
	run, cfg, cleanup := prepare(t)
	defer cleanup()
	cfg.Experimental = "disabled"
	err := cfg.Save()
	assert.NilError(t, err)

	cmd := run("helloworld")
	cmd.Env = append(os.Environ(), "HELLO_EXPERIMENTAL=enabled")

	res := icmd.RunCmd(cmd)
	res.Assert(t, icmd.Expected{
		ExitCode: 1,
		Out:      icmd.None,
		Err:      "plugin candidate helloworld: requires experimental CLI",
	})
}

// TestPluginExperimentalWithExperimentalCLI tests when the plugin is labelled as experimental and
// the CLI too. The plugin should just work fine.
func TestPluginExperimentalWithExperimentalCLI(t *testing.T) {
	run, cfg, cleanup := prepare(t)
	defer cleanup()
	cfg.Experimental = "enabled"
	err := cfg.Save()
	assert.NilError(t, err)

	cmd := run("helloworld")
	cmd.Env = append(os.Environ(), "HELLO_EXPERIMENTAL=enabled")

	res := icmd.RunCmd(cmd)
	res.Assert(t, icmd.Expected{
		ExitCode: 0,
		Out:      "Hello World!",
		Err:      icmd.None,
	})
}
(paste your output here)

Additional environment details (AWS, VirtualBox, physical, etc.):

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.