{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/60444","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/60444/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/60444/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/60444/events","html_url":"https://github.com/kubernetes/kubernetes/issues/60444","id":300358918,"number":60444,"title":"Code generator generates invalid fake clients for nonnamespaced subresources","user":{"login":"jhorwit2","id":3876739,"avatar_url":"https://avatars1.githubusercontent.com/u/3876739?v=4","gravatar_id":"","url":"https://api.github.com/users/jhorwit2","html_url":"https://github.com/jhorwit2","followers_url":"https://api.github.com/users/jhorwit2/followers","following_url":"https://api.github.com/users/jhorwit2/following{/other_user}","gists_url":"https://api.github.com/users/jhorwit2/gists{/gist_id}","starred_url":"https://api.github.com/users/jhorwit2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhorwit2/subscriptions","organizations_url":"https://api.github.com/users/jhorwit2/orgs","repos_url":"https://api.github.com/users/jhorwit2/repos","events_url":"https://api.github.com/users/jhorwit2/events{/privacy}","received_events_url":"https://api.github.com/users/jhorwit2/received_events","type":"User","site_admin":false},"labels":[{"id":105146071,"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/kind/bug","name":"kind/bug","color":"e11d21","default":false},{"id":173493835,"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/sig/api-machinery","name":"sig/api-machinery","color":"d2b48c","default":false}],"state":"open","locked":false,"assignee":{"login":"jhorwit2","id":3876739,"avatar_url":"https://avatars1.githubusercontent.com/u/3876739?v=4","gravatar_id":"","url":"https://api.github.com/users/jhorwit2","html_url":"https://github.com/jhorwit2","followers_url":"https://api.github.com/users/jhorwit2/followers","following_url":"https://api.github.com/users/jhorwit2/following{/other_user}","gists_url":"https://api.github.com/users/jhorwit2/gists{/gist_id}","starred_url":"https://api.github.com/users/jhorwit2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhorwit2/subscriptions","organizations_url":"https://api.github.com/users/jhorwit2/orgs","repos_url":"https://api.github.com/users/jhorwit2/repos","events_url":"https://api.github.com/users/jhorwit2/events{/privacy}","received_events_url":"https://api.github.com/users/jhorwit2/received_events","type":"User","site_admin":false},"assignees":[{"login":"jhorwit2","id":3876739,"avatar_url":"https://avatars1.githubusercontent.com/u/3876739?v=4","gravatar_id":"","url":"https://api.github.com/users/jhorwit2","html_url":"https://github.com/jhorwit2","followers_url":"https://api.github.com/users/jhorwit2/followers","following_url":"https://api.github.com/users/jhorwit2/following{/other_user}","gists_url":"https://api.github.com/users/jhorwit2/gists{/gist_id}","starred_url":"https://api.github.com/users/jhorwit2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhorwit2/subscriptions","organizations_url":"https://api.github.com/users/jhorwit2/orgs","repos_url":"https://api.github.com/users/jhorwit2/repos","events_url":"https://api.github.com/users/jhorwit2/events{/privacy}","received_events_url":"https://api.github.com/users/jhorwit2/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2018-02-26T19:08:48Z","updated_at":"2018-04-09T08:56:48Z","closed_at":null,"author_association":"MEMBER","body":"<!-- This form is for bug reports and feature requests ONLY! \r\n\r\nIf you're looking for help check [Stack Overflow](https://stackoverflow.com/questions/tagged/kubernetes) and the [troubleshooting guide](https://kubernetes.io/docs/tasks/debug-application-cluster/troubleshooting/).\r\n-->\r\n\r\n**Is this a BUG REPORT or FEATURE REQUEST?**:\r\n\r\n/kind bug\r\n\r\n**What happened**:\r\n\r\nget, list, update and create for non-namespaced subresources generate invalid code. \r\n\r\nI have the following code generation annotations\r\n\r\n```\r\n// +genclient\r\n// +genclient:nonNamespaced\r\n// +genclient:method=GetScale,verb=get,subresource=scale,result=k8s.io/kubernetes/pkg/apis/autoscaling.Scale\r\n// +genclient:method=UpdateScale,verb=update,subresource=scale,input=k8s.io/kubernetes/pkg/apis/autoscaling.Scale,result=k8s.io/kubernetes/pkg/apis/autoscaling.Scale\r\n// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object\r\n```\r\n\r\nwhich generated\r\n```\r\n// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.\r\nfunc (c *FakeMachineSets) UpdateScale(machineSetName string, scale *autoscaling.Scale) (result *autoscaling.Scale, err error) {\r\n    obj, err := c.Fake.\r\n        Invokes(testing.NewRootUpdateAction(machineSetName, machineSet), &api.MachineSet{})\r\n    if obj == nil {\r\n        return nil, err\r\n    }\r\n    return obj.(*autoscaling.Scale), err\r\n}\r\n```\r\n\r\n**What you expected to happen**:\r\n\r\nIt should be \r\n\r\n```\r\n// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.\r\nfunc (c *FakeMachineSets) UpdateScale(machineSetName string, scale *autoscaling.Scale) (result *autoscaling.Scale, err error) {\r\n\tobj, err := c.Fake.\r\n\t\tInvokes(testing.NewRootUpdateSubresourceAction(machinesetsResource, \"scale\", scale), &autoscaling.Scale{})\r\n\tif obj == nil {\r\n\t\treturn nil, err\r\n\t}\r\n\treturn obj.(*autoscaling.Scale), err\r\n}\r\n\r\n```\r\n\r\n**How to reproduce it (as minimally and precisely as possible)**:\r\n\r\nGenerate clients for non-namespaced resources with subresources (like scale). \r\n\r\n\r\n/sig api-machinery\r\n/area code-generator\r\n/assign"},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/379682583","html_url":"https://github.com/kubernetes/kubernetes/issues/60444#issuecomment-379682583","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/60444","id":379682583,"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},"created_at":"2018-04-09T08:56:48Z","updated_at":"2018-04-09T08:56:48Z","author_association":"MEMBER","body":"/area code-generation"}}
{"actor":{"display_login":"nikhita"}}