{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/55168","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/55168/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/55168/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/55168/events","html_url":"https://github.com/kubernetes/kubernetes/pull/55168","id":271495633,"number":55168,"title":"[WIP] apiextensions: add subresources for custom resources","user":{"login":"nikhita","id":16105680,"avatar_url":"https://avatars1.githubusercontent.com/u/16105680?v=4","gravatar_id":"","url":"https://api.github.com/users/nikhita","html_url":"https://github.com/nikhita","followers_url":"https://api.github.com/users/nikhita/followers","following_url":"https://api.github.com/users/nikhita/following{/other_user}","gists_url":"https://api.github.com/users/nikhita/gists{/gist_id}","starred_url":"https://api.github.com/users/nikhita/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikhita/subscriptions","organizations_url":"https://api.github.com/users/nikhita/orgs","repos_url":"https://api.github.com/users/nikhita/repos","events_url":"https://api.github.com/users/nikhita/events{/privacy}","received_events_url":"https://api.github.com/users/nikhita/received_events","type":"User","site_admin":false},"labels":[{"id":556590057,"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/area/custom-resources","name":"area/custom-resources","color":"0052cc","default":false},{"id":477397086,"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/cncf-cla:%20yes","name":"cncf-cla: yes","color":"bfe5bf","default":false},{"id":687500047,"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/do-not-merge/work-in-progress","name":"do-not-merge/work-in-progress","color":"e11d21","default":false},{"id":261005360,"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/kind/api-change","name":"kind/api-change","color":"c7def8","default":false},{"id":200149833,"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/release-note","name":"release-note","color":"c2e0c6","default":false},{"id":173493835,"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/sig/api-machinery","name":"sig/api-machinery","color":"d2b48c","default":false},{"id":238245616,"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/sig/autoscaling","name":"sig/autoscaling","color":"d2b48c","default":false},{"id":253451093,"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/size/XXL","name":"size/XXL","color":"ee0000","default":false}],"state":"open","locked":false,"assignee":{"login":"deads2k","id":8225098,"avatar_url":"https://avatars0.githubusercontent.com/u/8225098?v=4","gravatar_id":"","url":"https://api.github.com/users/deads2k","html_url":"https://github.com/deads2k","followers_url":"https://api.github.com/users/deads2k/followers","following_url":"https://api.github.com/users/deads2k/following{/other_user}","gists_url":"https://api.github.com/users/deads2k/gists{/gist_id}","starred_url":"https://api.github.com/users/deads2k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deads2k/subscriptions","organizations_url":"https://api.github.com/users/deads2k/orgs","repos_url":"https://api.github.com/users/deads2k/repos","events_url":"https://api.github.com/users/deads2k/events{/privacy}","received_events_url":"https://api.github.com/users/deads2k/received_events","type":"User","site_admin":false},"assignees":[{"login":"sttts","id":730123,"avatar_url":"https://avatars0.githubusercontent.com/u/730123?v=4","gravatar_id":"","url":"https://api.github.com/users/sttts","html_url":"https://github.com/sttts","followers_url":"https://api.github.com/users/sttts/followers","following_url":"https://api.github.com/users/sttts/following{/other_user}","gists_url":"https://api.github.com/users/sttts/gists{/gist_id}","starred_url":"https://api.github.com/users/sttts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sttts/subscriptions","organizations_url":"https://api.github.com/users/sttts/orgs","repos_url":"https://api.github.com/users/sttts/repos","events_url":"https://api.github.com/users/sttts/events{/privacy}","received_events_url":"https://api.github.com/users/sttts/received_events","type":"User","site_admin":false},{"login":"enisoc","id":6733629,"avatar_url":"https://avatars3.githubusercontent.com/u/6733629?v=4","gravatar_id":"","url":"https://api.github.com/users/enisoc","html_url":"https://github.com/enisoc","followers_url":"https://api.github.com/users/enisoc/followers","following_url":"https://api.github.com/users/enisoc/following{/other_user}","gists_url":"https://api.github.com/users/enisoc/gists{/gist_id}","starred_url":"https://api.github.com/users/enisoc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enisoc/subscriptions","organizations_url":"https://api.github.com/users/enisoc/orgs","repos_url":"https://api.github.com/users/enisoc/repos","events_url":"https://api.github.com/users/enisoc/events{/privacy}","received_events_url":"https://api.github.com/users/enisoc/received_events","type":"User","site_admin":false},{"login":"deads2k","id":8225098,"avatar_url":"https://avatars0.githubusercontent.com/u/8225098?v=4","gravatar_id":"","url":"https://api.github.com/users/deads2k","html_url":"https://github.com/deads2k","followers_url":"https://api.github.com/users/deads2k/followers","following_url":"https://api.github.com/users/deads2k/following{/other_user}","gists_url":"https://api.github.com/users/deads2k/gists{/gist_id}","starred_url":"https://api.github.com/users/deads2k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deads2k/subscriptions","organizations_url":"https://api.github.com/users/deads2k/orgs","repos_url":"https://api.github.com/users/deads2k/repos","events_url":"https://api.github.com/users/deads2k/events{/privacy}","received_events_url":"https://api.github.com/users/deads2k/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2017-11-06T14:34:38Z","updated_at":"2017-11-20T15:51:41Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/55168","html_url":"https://github.com/kubernetes/kubernetes/pull/55168","diff_url":"https://github.com/kubernetes/kubernetes/pull/55168.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/55168.patch"},"body":"**Add types**:\r\n\r\n- Add `CustomResourceSubResources` type to CRD.\r\n    - Fix proto generation for `CustomResourceSubResourceStatus`: https://github.com/kubernetes/kubernetes/pull/55970.\r\n- Add feature gate for `CustomResourceSubResources`.\r\n    - Update CRD strategy: if feature gate is disabled, this feature is dropped (i.e. set to `nil`).\r\n- Add validation for `CustomResourceSubResources`: `SpecReplicasPath` should not be empty and `ScaleGroupVersion` should point to `autoscaling/v1`.\r\n\r\n**Add status and scale subresources**:\r\n- Use helper functions from `apimachinery/pkg/apis/meta/v1/unstructured/helpers.go`.\r\n- Introduce Registry interface for storage.\r\n- Update storage:\r\n    - Introduce `CustomResourceStorage` which acts as storage for the custom resource and its status and scale subresources.\r\n    - Introduce `StatusREST` and its `New()`, `Get()` and `Update()` methods.\r\n    - Introduce `ScaleREST` and its `New()`, `Get()` and `Update()` methods.\r\n- Update strategy:\r\n    - In `PrepareForCreate`,\r\n         - clear status\r\n         - set generation = 1\r\n    - In `PrepareForUpdate`,\r\n         - set status back to its old value (update should not set status)\r\n         - increment generation if spec changes\r\n    - For validation, if subresources are enabled, do not allow anything other than `properties` in the root schema.\r\n    - Introduce `customResourceStatusStrategy` with its methods.\r\n        - In `PrepareForUpdate`, set spec back to its old value (update should not set spec)\r\n        - for validation, only validate the status\r\n- Plug into the custom resource handler:\r\n    - Store all three storage - customResource, status and scale in `crdInfo`.\r\n    - Use the storage as per the subresource in the request.\r\n    - set the JSONPath for scale fields as strings.\r\n\r\n**Add tests**:\r\n\r\n- Add unit tests in `etcd_test.go`:\r\n    - `TestCreate`, `TestGet`, `TestList`, `TestDelete` and `TestCategories`.\r\n    -  `TestStatusUpdate`, `TestScaleGet` and `TestScaleUpdate`.\r\n- **[TODO]** Add more (integration) tests.\r\n\r\n**Release note**:\r\n<!--  Write your release note:\r\n1. Enter your extended release note in the below block. If the PR requires additional action from users switching to the new release, include the string \"action required\".\r\n2. If no release note is required, just write \"NONE\".\r\n-->\r\n```release-note\r\nAdd `/status` and `/scale` subresources for custom resources\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/345737251","html_url":"https://github.com/kubernetes/kubernetes/pull/55168#issuecomment-345737251","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/55168","id":345737251,"user":{"login":"k8s-ci-robot","id":20407524,"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":"2017-11-20T15:51:41Z","updated_at":"2017-11-20T15:51:41Z","author_association":"COLLABORATOR","body":"@nikhita: The following tests **failed**, say `/retest` to rerun them all:\n\nTest name | Commit | Details | Rerun command\n--- | --- | --- | ---\npull-kubernetes-unit | fd9630ce979ad3a9484049bb62fe6e1eb1b30a78 | [link](https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/55168/pull-kubernetes-unit/66922/) | `/test pull-kubernetes-unit`\npull-kubernetes-node-e2e | fd9630ce979ad3a9484049bb62fe6e1eb1b30a78 | [link](https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/55168/pull-kubernetes-node-e2e/63621/) | `/test pull-kubernetes-node-e2e`\npull-kubernetes-verify | fd9630ce979ad3a9484049bb62fe6e1eb1b30a78 | [link](https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/55168/pull-kubernetes-verify/63887/) | `/test pull-kubernetes-verify`\npull-kubernetes-e2e-gce | 7983c1a6825bea795f73f926f89af7e83304a6c3 | [link](https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/55168/pull-kubernetes-e2e-gce/7834/) | `/test pull-kubernetes-e2e-gce`\npull-kubernetes-e2e-gce-device-plugin-gpu | 7983c1a6825bea795f73f926f89af7e83304a6c3 | [link](https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/55168/pull-kubernetes-e2e-gce-device-plugin-gpu/6186/) | `/test pull-kubernetes-e2e-gce-device-plugin-gpu`\npull-kubernetes-bazel-test | 7983c1a6825bea795f73f926f89af7e83304a6c3 | [link](https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/55168/pull-kubernetes-bazel-test/18433/) | `/test pull-kubernetes-bazel-test`\npull-kubernetes-bazel-build | 7983c1a6825bea795f73f926f89af7e83304a6c3 | [link](https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/55168/pull-kubernetes-bazel-build/17410/) | `/test pull-kubernetes-bazel-build`\n\n[Full PR test history](https://k8s-gubernator.appspot.com/pr/55168). [Your PR dashboard](https://k8s-gubernator.appspot.com/pr/nikhita). Please help us cut down on flakes by [linking to](https://github.com/kubernetes/community/blob/master/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://github.com/kubernetes/community/blob/master/contributors/devel/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://github.com/kubernetes/test-infra/blob/master/commands.md).\n</details>\n<!-- test report -->"}}
{"actor":{"display_login":"k8s-ci-robot"}}