{"action":"created","issue":{"url":"https://api.github.com/repos/kubevirt/kubevirt/issues/960","repository_url":"https://api.github.com/repos/kubevirt/kubevirt","labels_url":"https://api.github.com/repos/kubevirt/kubevirt/issues/960/labels{/name}","comments_url":"https://api.github.com/repos/kubevirt/kubevirt/issues/960/comments","events_url":"https://api.github.com/repos/kubevirt/kubevirt/issues/960/events","html_url":"https://github.com/kubevirt/kubevirt/pull/960","id":318187312,"number":960,"title":"Support UI validation by adding \"causes\" list to webhook response","user":{"login":"davidvossel","id":683713,"avatar_url":"https://avatars0.githubusercontent.com/u/683713?v=4","gravatar_id":"","url":"https://api.github.com/users/davidvossel","html_url":"https://github.com/davidvossel","followers_url":"https://api.github.com/users/davidvossel/followers","following_url":"https://api.github.com/users/davidvossel/following{/other_user}","gists_url":"https://api.github.com/users/davidvossel/gists{/gist_id}","starred_url":"https://api.github.com/users/davidvossel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidvossel/subscriptions","organizations_url":"https://api.github.com/users/davidvossel/orgs","repos_url":"https://api.github.com/users/davidvossel/repos","events_url":"https://api.github.com/users/davidvossel/events{/privacy}","received_events_url":"https://api.github.com/users/davidvossel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-04-26T20:36:08Z","updated_at":"2018-05-01T01:09:39Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/kubevirt/kubevirt/pulls/960","html_url":"https://github.com/kubevirt/kubevirt/pull/960","diff_url":"https://github.com/kubevirt/kubevirt/pull/960.diff","patch_url":"https://github.com/kubevirt/kubevirt/pull/960.patch"},"body":"The UI needs a standardized way of determine what validation errors occurred and exactly what fields were involved. \r\n\r\nWith this PR, the metav1.Status{} structure returned in the validation webhook's Admission Review Response contains a list of information about every field that failed validation. \r\n\r\nExample:\r\n\r\n```\r\n{\r\n  \"kind\": \"Status\",\r\n  \"apiVersion\": \"v1\",\r\n  \"metadata\": {},\r\n  \"status\": \"Failure\",\r\n  \"message\": \"admission webhook \\\"virtualmachine-validator.kubevirt.io\\\" denied the request: spec.domain.devices.disks[1].volumeName testvolume not found.\",\r\n  \"details\": {\r\n    \"causes\": [\r\n      {\r\n        \"message\": \"testvolume not found\",\r\n        \"field\": spec.domain.devices.disks[1],\r\n      },\r\n      {\r\n        \"message\": \"testvolume2 not found\",\r\n        \"field\": spec.domain.devices.disks[2],\r\n      },\r\n    ]\r\n  },\r\n  \"code\": 422\r\n}\r\n```\r\n\r\nA UI can iterate over the causes list to identify which field is invalid. There's also a human readable string associated with each validation error. \r\n\r\nUnit and Functional tests have been updated to ensure the field values are both set and accurate for consumption. \r\n\r\nfixes #959\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/kubevirt/kubevirt/issues/comments/385574271","html_url":"https://github.com/kubevirt/kubevirt/pull/960#issuecomment-385574271","issue_url":"https://api.github.com/repos/kubevirt/kubevirt/issues/960","id":385574271,"user":{"login":"davidvossel","id":683713,"avatar_url":"https://avatars0.githubusercontent.com/u/683713?v=4","gravatar_id":"","url":"https://api.github.com/users/davidvossel","html_url":"https://github.com/davidvossel","followers_url":"https://api.github.com/users/davidvossel/followers","following_url":"https://api.github.com/users/davidvossel/following{/other_user}","gists_url":"https://api.github.com/users/davidvossel/gists{/gist_id}","starred_url":"https://api.github.com/users/davidvossel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidvossel/subscriptions","organizations_url":"https://api.github.com/users/davidvossel/orgs","repos_url":"https://api.github.com/users/davidvossel/repos","events_url":"https://api.github.com/users/davidvossel/events{/privacy}","received_events_url":"https://api.github.com/users/davidvossel/received_events","type":"User","site_admin":false},"created_at":"2018-05-01T01:09:39Z","updated_at":"2018-05-01T01:09:39Z","author_association":"MEMBER","body":"retest this please"}}
{"actor":{"display_login":"davidvossel"}}