{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/66876","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/66876/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/66876/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/66876/events","html_url":"https://github.com/kubernetes/kubernetes/pull/66876","id":346787312,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA1NTY2OTQ5","number":66876,"title":"Add updated plugin mechanism","user":{"login":"juanvallejo","id":3902875,"node_id":"MDQ6VXNlcjM5MDI4NzU=","avatar_url":"https://avatars2.githubusercontent.com/u/3902875?v=4","gravatar_id":"","url":"https://api.github.com/users/juanvallejo","html_url":"https://github.com/juanvallejo","followers_url":"https://api.github.com/users/juanvallejo/followers","following_url":"https://api.github.com/users/juanvallejo/following{/other_user}","gists_url":"https://api.github.com/users/juanvallejo/gists{/gist_id}","starred_url":"https://api.github.com/users/juanvallejo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juanvallejo/subscriptions","organizations_url":"https://api.github.com/users/juanvallejo/orgs","repos_url":"https://api.github.com/users/juanvallejo/repos","events_url":"https://api.github.com/users/juanvallejo/events{/privacy}","received_events_url":"https://api.github.com/users/juanvallejo/received_events","type":"User","site_admin":false},"labels":[{"id":477397086,"node_id":"MDU6TGFiZWw0NzczOTcwODY=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/cncf-cla:%20yes","name":"cncf-cla: yes","color":"bfe5bf","default":false},{"id":200149833,"node_id":"MDU6TGFiZWwyMDAxNDk4MzM=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/release-note","name":"release-note","color":"c2e0c6","default":false},{"id":450823910,"node_id":"MDU6TGFiZWw0NTA4MjM5MTA=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/sig/cli","name":"sig/cli","color":"d2b48c","default":false},{"id":253451093,"node_id":"MDU6TGFiZWwyNTM0NTEwOTM=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/size/XXL","name":"size/XXL","color":"ee0000","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-01T22:06:29Z","updated_at":"2018-08-01T22:34:28Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/66876","html_url":"https://github.com/kubernetes/kubernetes/pull/66876","diff_url":"https://github.com/kubernetes/kubernetes/pull/66876.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/66876.patch"},"body":"**Release note**:\r\n```release-note\r\nThe plugin mechanism functionality to closely follow the git plugin design\r\n```\r\n\r\nReplace the existing plugin mechanism with the design proposed in https://github.com/kubernetes/community/pull/2437.\r\n\r\n_The full implementation of the plugin mechanism itself is entirely contained within the first commit_. \r\n\r\n## Walkthrough\r\n\r\nUnder the new design, there is no plugin installation or loading required to use plugins.\r\nA plugin is simply any executable file on a user's PATH whose name begins with `kubectl-`.\r\n- Plugins receive the inherited environment from the `kubectl` binary. All environment variables\r\naccessible by `kubectl` become accessible by the plugin.\r\n- Plugins decide which command path they wish to implement based on their name. For example, a plugin wanting to provide a new command `foo`, would simply be named `kubectl-foo`.\r\n\r\n### Creating a plugin\r\n\r\nBelow is an example plugin, that we will use for this walkthrough. Plugins may be written in any language, and handle arguments and flags in any way, optionally (as a convention) providing a way to retrieve their version via a `version` subcommand.\r\n\r\n```bash\r\n#!/bin/bash\r\n\r\n# optional argument handling\r\nif [[ \"$1\" == \"version\" ]]\r\nthen\r\n    echo \"1.0.0\"\r\n    exit 0\r\nfi\r\n\r\n# optional argument handling\r\nif [[ \"$1\" == \"config\" ]]\r\nthen\r\n    echo $KUBECONFIG\r\n    exit 0\r\nfi\r\n\r\necho \"I am a plugin named kubectl-foo\"\r\n```\r\n\r\n### Using a plugin\r\n\r\nTo use a plugin, simply make it executable:\r\n\r\n```bash\r\nsudo chmod +x ./kubectl-foo\r\n```\r\n\r\nand place it anywhere in your PATH:\r\n\r\n```bash\r\nsudo mv ./kubectl-foo /usr/local/bin\r\n```\r\n\r\nYou may now invoke your plugin as a `kubectl` command:\r\n\r\n```bash\r\n$ kubectl foo\r\nI am a plugin named kubectl-foo\r\n```\r\n\r\nAll args and flags are passed as-is to the executable:\r\n\r\n```bash\r\n$ kubectl foo version\r\n1.0.0\r\n```\r\n\r\nAll environment variables are also passed as-is to the executable:\r\n\r\n```bash\r\n$ export KUBECONFIG=~/.kube/config\r\n$ kubectl foo config\r\n/home/<user>/.kube/config\r\n\r\n$ KUBECONFIG=/etc/kube/config kubectl foo config\r\n/etc/kube/config\r\n```\r\n\r\nAdditionally, the first argument that is passed to a plugin will always be the full path to the location where it was invoked (`$0` would equal `/usr/local/bin/kubectl-foo` in our example above).\r\n\r\n### List available plugins\r\n\r\nSeeing as how the `kubectl plugin` command is left as a no-op with this PR (perhaps it could serve as an entrypoint towards additional plugin functionality in the future), a small subcommand has been included that lists all \"valid\" plugin executables on a user's PATH.\r\n\r\ncc @kubernetes/kubectl-maintainers @kubernetes/sig-cli-pr-reviews @soltysh @seans3 @mengqiy "},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/409746989","html_url":"https://github.com/kubernetes/kubernetes/pull/66876#issuecomment-409746989","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/66876","id":409746989,"node_id":"MDEyOklzc3VlQ29tbWVudDQwOTc0Njk4OQ==","user":{"login":"k8s-ci-robot","id":20407524,"node_id":"MDQ6VXNlcjIwNDA3NTI0","avatar_url":"https://avatars0.githubusercontent.com/u/20407524?v=4","gravatar_id":"","url":"https://api.github.com/users/k8s-ci-robot","html_url":"https://github.com/k8s-ci-robot","followers_url":"https://api.github.com/users/k8s-ci-robot/followers","following_url":"https://api.github.com/users/k8s-ci-robot/following{/other_user}","gists_url":"https://api.github.com/users/k8s-ci-robot/gists{/gist_id}","starred_url":"https://api.github.com/users/k8s-ci-robot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k8s-ci-robot/subscriptions","organizations_url":"https://api.github.com/users/k8s-ci-robot/orgs","repos_url":"https://api.github.com/users/k8s-ci-robot/repos","events_url":"https://api.github.com/users/k8s-ci-robot/events{/privacy}","received_events_url":"https://api.github.com/users/k8s-ci-robot/received_events","type":"User","site_admin":false},"created_at":"2018-08-01T22:34:28Z","updated_at":"2018-08-01T22:34:28Z","author_association":"COLLABORATOR","body":"@juanvallejo: The following tests **failed**, say `/retest` to rerun them all:\n\nTest name | Commit | Details | Rerun command\n--- | --- | --- | ---\npull-kubernetes-e2e-gce | 2ab0485701d4554a7188ee5ea61863e1a7739575 | [link](https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/66876/pull-kubernetes-e2e-gce/46413/) | `/test pull-kubernetes-e2e-gce`\npull-kubernetes-e2e-gce-100-performance | 2ab0485701d4554a7188ee5ea61863e1a7739575 | [link](https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/66876/pull-kubernetes-e2e-gce-100-performance/14644/) | `/test pull-kubernetes-e2e-gce-100-performance`\npull-kubernetes-e2e-gce-device-plugin-gpu | 2ab0485701d4554a7188ee5ea61863e1a7739575 | [link](https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/66876/pull-kubernetes-e2e-gce-device-plugin-gpu/41781/) | `/test pull-kubernetes-e2e-gce-device-plugin-gpu`\npull-kubernetes-e2e-kops-aws | 2ab0485701d4554a7188ee5ea61863e1a7739575 | [link](https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/66876/pull-kubernetes-e2e-kops-aws/99344/) | `/test pull-kubernetes-e2e-kops-aws`\npull-kubernetes-kubemark-e2e-gce-big | 2ab0485701d4554a7188ee5ea61863e1a7739575 | [link](https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/66876/pull-kubernetes-kubemark-e2e-gce-big/16289/) | `/test pull-kubernetes-kubemark-e2e-gce-big`\npull-kubernetes-typecheck | 2ab0485701d4554a7188ee5ea61863e1a7739575 | [link](https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/66876/pull-kubernetes-typecheck/18966/) | `/test pull-kubernetes-typecheck`\npull-kubernetes-integration | 2ab0485701d4554a7188ee5ea61863e1a7739575 | [link](https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/66876/pull-kubernetes-integration/21315/) | `/test pull-kubernetes-integration`\npull-kubernetes-bazel-build | ff8cf2b3620524c1e6980c135991825188d12c42 | [link](https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/66876/pull-kubernetes-bazel-build/52048/) | `/test pull-kubernetes-bazel-build`\npull-kubernetes-bazel-test | ff8cf2b3620524c1e6980c135991825188d12c42 | [link](https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/66876/pull-kubernetes-bazel-test/54567/) | `/test pull-kubernetes-bazel-test`\n\n[Full PR test history](https://k8s-gubernator.appspot.com/pr/66876). [Your PR dashboard](https://k8s-gubernator.appspot.com/pr/juanvallejo). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes/kubernetes/issues?q=is:issue+is:open) when you hit one in your PR.\n\n<details>\n\nInstructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).\n</details>\n<!-- test report -->"}}
{"actor":{"display_login":"k8s-ci-robot"}}