{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/18185","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/18185/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/18185/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/18185/events","html_url":"https://github.com/kubernetes/kubernetes/issues/18185","id":120307006,"number":18185,"title":"Needed: field-level extension mechanism","user":{"login":"lavalamp","id":647318,"avatar_url":"https://avatars.githubusercontent.com/u/647318?v=3","gravatar_id":"","url":"https://api.github.com/users/lavalamp","html_url":"https://github.com/lavalamp","followers_url":"https://api.github.com/users/lavalamp/followers","following_url":"https://api.github.com/users/lavalamp/following{/other_user}","gists_url":"https://api.github.com/users/lavalamp/gists{/gist_id}","starred_url":"https://api.github.com/users/lavalamp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lavalamp/subscriptions","organizations_url":"https://api.github.com/users/lavalamp/orgs","repos_url":"https://api.github.com/users/lavalamp/repos","events_url":"https://api.github.com/users/lavalamp/events{/privacy}","received_events_url":"https://api.github.com/users/lavalamp/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/area/api","name":"area/api","color":"e1ed21"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/kind/design","name":"kind/design","color":"c7def8"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/priority/P2","name":"priority/P2","color":"fbca04"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/team/CSI","name":"team/CSI","color":"d2b48c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-04T00:45:47Z","updated_at":"2015-12-04T01:04:21Z","closed_at":null,"body":"We don't have a good mechanism for plugging extension fields into objects. That is, suppose we have an Autoscaler type, and we want user on FooCloud to be able to set some extra fields in Autoscaler.FooExtensions for the FooCloudProvider to make use of.\r\n\r\nCurrently, we do this by letting everyone add a *FooCloudOptions variable into the Autoscaler type. The downside of this is that people have to modify things in our code base, and that these options appear whether or not they actually exist on the cluster.\r\n\r\nAnother alternative is adding a `CloudProviderOptions RawExtension` (e.g., []byte) and letting people dump whatever options they want there. This has the downside that apiserver can't validate or document the contents of that field, nor can it convert it between versions, etc. Using an annotation is basically the same thing.\r\n\r\nSo my idea here is to leverage federated API servers. Basically, you'd make a new apiserver (which should be very easy in the future) and drop-in a Autoscaler type. This would be exactly the same as the main Autoscaler type, except for the addition of your custom fields. (We'd have to make some rules so this can work correctly.) Then we point /apis/scale/autoscalers at your apiserver instead of the main apiserver.\r\n\r\nThe downsides:\r\n* depends on incomplete features.\r\n* Only one such override per resource per cluster would be possible.\r\n* Only possible for resources that don't have custom apiserver logic (which should be everything)\r\n\r\nBut the good part is that we'd be able to deliver the validation, documentation, conversion features users expect."},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/161841826","html_url":"https://github.com/kubernetes/kubernetes/issues/18185#issuecomment-161841826","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/18185","id":161841826,"user":{"login":"smarterclayton","id":1163175,"avatar_url":"https://avatars.githubusercontent.com/u/1163175?v=3","gravatar_id":"","url":"https://api.github.com/users/smarterclayton","html_url":"https://github.com/smarterclayton","followers_url":"https://api.github.com/users/smarterclayton/followers","following_url":"https://api.github.com/users/smarterclayton/following{/other_user}","gists_url":"https://api.github.com/users/smarterclayton/gists{/gist_id}","starred_url":"https://api.github.com/users/smarterclayton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarterclayton/subscriptions","organizations_url":"https://api.github.com/users/smarterclayton/orgs","repos_url":"https://api.github.com/users/smarterclayton/repos","events_url":"https://api.github.com/users/smarterclayton/events{/privacy}","received_events_url":"https://api.github.com/users/smarterclayton/received_events","type":"User","site_admin":false},"created_at":"2015-12-04T01:04:21Z","updated_at":"2015-12-04T01:04:21Z","body":"I like the idea.  It's true composition."}}