{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/67840","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/67840/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/67840/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/67840/events","html_url":"https://github.com/kubernetes/kubernetes/issues/67840","id":353865412,"node_id":"MDU6SXNzdWUzNTM4NjU0MTI=","number":67840,"title":"CRD: Consider changing schema language","user":{"login":"lavalamp","id":647318,"node_id":"MDQ6VXNlcjY0NzMxOA==","avatar_url":"https://avatars0.githubusercontent.com/u/647318?v=4","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":[{"id":556590057,"node_id":"MDU6TGFiZWw1NTY1OTAwNTc=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/area/custom-resources","name":"area/custom-resources","color":"0052cc","default":false},{"id":267761362,"node_id":"MDU6TGFiZWwyNjc3NjEzNjI=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/kind/feature","name":"kind/feature","color":"c7def8","default":false},{"id":173493835,"node_id":"MDU6TGFiZWwxNzM0OTM4MzU=","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":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2018-08-24T17:24:48Z","updated_at":"2018-08-31T06:16:42Z","closed_at":null,"author_association":"MEMBER","body":"Right now, CRDs accept a schema in the form OpenAPI v3 / json-schema.\r\n\r\nWhile it is true that apiserver publishes OpenAPI (though v2) schema docs, I increasingly think that OpenAPI is not a good schema definition mechanism for CRDs or Kubernetes resources in general. Why? It allows mixing \"type validation\" and \"value validation\" in inseparable ways, which is impossible to faithfully adhere to in our deserialization stack. It allows expressing many objects which would not conform to the \"Kubernetes Object Model\" (for lack of a better phrase). Forbidding spec documents which won't work in our system is time consuming for us and will be confusing to users.\r\n\r\nPeople today define their resources in our \"Go IDL\", or (I hear) some extension authors have used proto. No one writes OpenAPI by hand directly, as far as I can tell. So, I don't think users will care (apart from the churn).\r\n\r\nWe have a great opportunity to replace it with something new at the moment, as we're deprecating the singular `validation` field anyway to replace it with the version list.\r\n\r\nOf course it's not obvious what to replace it with. Off the top of my head we have some choices:\r\n1. A string that contains the go types? (Will be fun to validate / use, but definitely not impossible)\r\n2. A targeted schema language that expresses our exact semantics? I have [started one](https://github.com/kubernetes/kubernetes/pull/67458/files) for apply, it can be expedited if it will be useful here.\r\n3. proto w/ extension tags? non-k8s googlers often expect this."},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/417563414","html_url":"https://github.com/kubernetes/kubernetes/issues/67840#issuecomment-417563414","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/67840","id":417563414,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNzU2MzQxNA==","user":{"login":"mbohlool","id":1613024,"node_id":"MDQ6VXNlcjE2MTMwMjQ=","avatar_url":"https://avatars3.githubusercontent.com/u/1613024?v=4","gravatar_id":"","url":"https://api.github.com/users/mbohlool","html_url":"https://github.com/mbohlool","followers_url":"https://api.github.com/users/mbohlool/followers","following_url":"https://api.github.com/users/mbohlool/following{/other_user}","gists_url":"https://api.github.com/users/mbohlool/gists{/gist_id}","starred_url":"https://api.github.com/users/mbohlool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbohlool/subscriptions","organizations_url":"https://api.github.com/users/mbohlool/orgs","repos_url":"https://api.github.com/users/mbohlool/repos","events_url":"https://api.github.com/users/mbohlool/events{/privacy}","received_events_url":"https://api.github.com/users/mbohlool/received_events","type":"User","site_admin":false},"created_at":"2018-08-31T06:16:42Z","updated_at":"2018-08-31T06:16:42Z","author_association":"MEMBER","body":"Adding one more detail to the idea, we can set the bar for restriction on OpenAPI schema using our own kube-openapi. Anything that kube-openapi cannot generate should not be allowed in the Schema of CRD. this will help us both develop kube-openapi to take care of all cases (structure and value validation in a separate way) and also make sure what we accept from users which may come from another source would be sound and not too much for api server's consumption."}}
{"actor":{"display_login":"mbohlool"}}