{"action":"created","issue":{"url":"https://api.github.com/repos/cloudfoundry/cli/issues/1512","repository_url":"https://api.github.com/repos/cloudfoundry/cli","labels_url":"https://api.github.com/repos/cloudfoundry/cli/issues/1512/labels{/name}","comments_url":"https://api.github.com/repos/cloudfoundry/cli/issues/1512/comments","events_url":"https://api.github.com/repos/cloudfoundry/cli/issues/1512/events","html_url":"https://github.com/cloudfoundry/cli/issues/1512","id":385294516,"node_id":"MDU6SXNzdWUzODUyOTQ1MTY=","number":1512,"title":"cf uninstall-plugin can be blocked forever","user":{"login":"gcapizzi","id":251425,"node_id":"MDQ6VXNlcjI1MTQyNQ==","avatar_url":"https://avatars3.githubusercontent.com/u/251425?v=4","gravatar_id":"","url":"https://api.github.com/users/gcapizzi","html_url":"https://github.com/gcapizzi","followers_url":"https://api.github.com/users/gcapizzi/followers","following_url":"https://api.github.com/users/gcapizzi/following{/other_user}","gists_url":"https://api.github.com/users/gcapizzi/gists{/gist_id}","starred_url":"https://api.github.com/users/gcapizzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gcapizzi/subscriptions","organizations_url":"https://api.github.com/users/gcapizzi/orgs","repos_url":"https://api.github.com/users/gcapizzi/repos","events_url":"https://api.github.com/users/gcapizzi/events{/privacy}","received_events_url":"https://api.github.com/users/gcapizzi/received_events","type":"User","site_admin":false},"labels":[{"id":52729334,"node_id":"MDU6TGFiZWw1MjcyOTMzNA==","url":"https://api.github.com/repos/cloudfoundry/cli/labels/bug","name":"bug","color":"fc2929","default":true},{"id":52729336,"node_id":"MDU6TGFiZWw1MjcyOTMzNg==","url":"https://api.github.com/repos/cloudfoundry/cli/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":371026367,"node_id":"MDU6TGFiZWwzNzEwMjYzNjc=","url":"https://api.github.com/repos/cloudfoundry/cli/labels/unscheduled","name":"unscheduled","color":"D9D9D9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-11-28T14:31:08Z","updated_at":"2018-11-29T09:33:01Z","closed_at":null,"author_association":"NONE","body":"**Please fill out the issue checklist below and provide ALL the requested information.**\r\n\r\n- [X] I tried updating to the latest version of the CF CLI to see if it fixed my problem.\r\n- [X] I attempted to run the command with `CF_TRACE=1` to help debug the issue.\r\n- [X] I am reporting a bug that others will be able to reproduce.\r\n\r\n**Describe the bug and the command you saw an issue with**\r\nOn plugin uninstall, the CLI [invokes the plugin with special args](https://github.com/cloudfoundry/cli/tree/master/plugin/plugin_examples#uninstalling-a-plugin) to notify it of the uninstall. If a plugin which blocks (e.g. waiting for user input or for streaming data) does not handle this case, it will be impossible to uninstall via `cf uninstall-plugin`.\r\n\r\n**Expected behavior**\r\nThe CLI should always be able to uninstall a plugin. Maybe it should take a force flag.\r\n\r\n**To Reproduce**\r\nSteps to reproduce the behavior; include the exact CLI commands and verbose output:\r\n1. Build the following plugin:\r\n  ```go\r\npackage main\r\n\r\nimport (\r\n\t\"time\"\r\n\r\n\t\"code.cloudfoundry.org/cli/plugin\"\r\n)\r\n\r\nfunc main() {\r\n\tplugin.Start(new(PluginDemonstratingParams))\r\n}\r\n\r\ntype PluginDemonstratingParams struct{}\r\n\r\nfunc (pluginDemo *PluginDemonstratingParams) Run(cliConnection plugin.CliConnection, args []string) {\r\n\ttime.Sleep(time.Hour)\r\n}\r\n\r\nfunc (pluginDemo *PluginDemonstratingParams) GetMetadata() plugin.PluginMetadata {\r\n\treturn plugin.PluginMetadata{\r\n\t\tName: \"BugDemo\",\r\n\t\tVersion: plugin.VersionType{\r\n\t\t\tMajor: 0,\r\n\t\t\tMinor: 0,\r\n\t\t\tBuild: 1,\r\n\t\t},\r\n\t\tCommands: []plugin.Command{\r\n\t\t\t{\r\n\t\t\t\tName:     \"test\",\r\n\t\t\t\tAlias:    \"\",\r\n\t\t\t\tHelpText: \"A test for a plugin uninstall bug\",\r\n\t\t\t\tUsageDetails: plugin.Usage{\r\n\t\t\t\t\tUsage: \"cf test\",\r\n\t\t\t\t},\r\n\t\t\t},\r\n\t\t},\r\n\t}\r\n}\r\n  ```\r\n2. Install the plugin\r\n3. Try to uninstall the plugin\r\n4. See the hang and ctrl +c out\r\n5. `cf plugins` still shows the plugin\r\n"},"comment":{"url":"https://api.github.com/repos/cloudfoundry/cli/issues/comments/442766499","html_url":"https://github.com/cloudfoundry/cli/issues/1512#issuecomment-442766499","issue_url":"https://api.github.com/repos/cloudfoundry/cli/issues/1512","id":442766499,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0Mjc2NjQ5OQ==","user":{"login":"gcapizzi","id":251425,"node_id":"MDQ6VXNlcjI1MTQyNQ==","avatar_url":"https://avatars3.githubusercontent.com/u/251425?v=4","gravatar_id":"","url":"https://api.github.com/users/gcapizzi","html_url":"https://github.com/gcapizzi","followers_url":"https://api.github.com/users/gcapizzi/followers","following_url":"https://api.github.com/users/gcapizzi/following{/other_user}","gists_url":"https://api.github.com/users/gcapizzi/gists{/gist_id}","starred_url":"https://api.github.com/users/gcapizzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gcapizzi/subscriptions","organizations_url":"https://api.github.com/users/gcapizzi/orgs","repos_url":"https://api.github.com/users/gcapizzi/repos","events_url":"https://api.github.com/users/gcapizzi/events{/privacy}","received_events_url":"https://api.github.com/users/gcapizzi/received_events","type":"User","site_admin":false},"created_at":"2018-11-29T09:33:01Z","updated_at":"2018-11-29T09:33:01Z","author_association":"NONE","body":"@abbyachau hi! Removing the executable from `~/.cf/plugins` and then running `cf uninstall-plugin` will show failure but work 😉 "}}
{"actor":{"display_login":"gcapizzi"}}