{"action":"created","comment":{"url":"https://api.github.com/repos/knative/pkg/pulls/comments/217896329","pull_request_review_id":155725960,"id":217896329,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNzg5NjMyOQ==","diff_hunk":"@@ -0,0 +1,78 @@\n+/*\n+Copyright 2018 The Knative Authors\n+\n+Licensed under the Apache License, Version 2.0 (the \"License\");\n+you may not use this file except in compliance with the License.\n+You may obtain a copy of the License at\n+\n+    http://www.apache.org/licenses/LICENSE-2.0\n+\n+Unless required by applicable law or agreed to in writing, software\n+distributed under the License is distributed on an \"AS IS\" BASIS,\n+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+See the License for the specific language governing permissions and\n+limitations under the License.\n+*/\n+\n+package validators\n+\n+import (\n+\t\"github.com/knative/pkg/apis\"\n+\n+\t\"k8s.io/apimachinery/pkg/util/validation\"\n+)\n+\n+const (\n+\tQualifiedName = \"QualifiedName\"\n+)\n+\n+// Usage:\n+//  OptionalName string `validate:\"QualifiedName\"`\n+//  RequiredName string `validate:\"QualifiedName,Required\"`\n+\n+func NewK8sQualifiedNameValidator(opts string) *K8sQualifiedNameValidator {\n+\trequired := false\n+\tif opts == \"Required\" {\n+\t\trequired = true\n+\t}\n+\treturn &K8sQualifiedNameValidator{\n+\t\trequired: required,\n+\t}\n+}\n+\n+type K8sQualifiedNameValidator struct {\n+\trequired bool\n+}\n+\n+var _ Validator = (*K8sQualifiedNameValidator)(nil)\n+\n+func (v *K8sQualifiedNameValidator) OnParent() bool {\n+\treturn false\n+}\n+\n+func (v *K8sQualifiedNameValidator) OnField() bool {\n+\treturn true\n+}\n+\n+func (v *K8sQualifiedNameValidator) Validate(fieldName string, value interface{}) (bool, *apis.FieldError) {","path":"apis/validators/k8s_qualified_name.go","position":57,"original_position":57,"commit_id":"3c01307addff024815b810c65e9e07e6d044f864","original_commit_id":"3c01307addff024815b810c65e9e07e6d044f864","user":{"login":"ImJasonH","id":210737,"node_id":"MDQ6VXNlcjIxMDczNw==","avatar_url":"https://avatars1.githubusercontent.com/u/210737?v=4","gravatar_id":"","url":"https://api.github.com/users/ImJasonH","html_url":"https://github.com/ImJasonH","followers_url":"https://api.github.com/users/ImJasonH/followers","following_url":"https://api.github.com/users/ImJasonH/following{/other_user}","gists_url":"https://api.github.com/users/ImJasonH/gists{/gist_id}","starred_url":"https://api.github.com/users/ImJasonH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ImJasonH/subscriptions","organizations_url":"https://api.github.com/users/ImJasonH/orgs","repos_url":"https://api.github.com/users/ImJasonH/repos","events_url":"https://api.github.com/users/ImJasonH/events{/privacy}","received_events_url":"https://api.github.com/users/ImJasonH/received_events","type":"User","site_admin":false},"body":"Could `Validate` just return err, and absence of error means it's valid?","created_at":"2018-09-15T21:48:31Z","updated_at":"2018-09-15T21:49:32Z","html_url":"https://github.com/knative/pkg/pull/37#discussion_r217896329","pull_request_url":"https://api.github.com/repos/knative/pkg/pulls/37","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/knative/pkg/pulls/comments/217896329"},"html":{"href":"https://github.com/knative/pkg/pull/37#discussion_r217896329"},"pull_request":{"href":"https://api.github.com/repos/knative/pkg/pulls/37"}}},"pull_request":{"url":"https://api.github.com/repos/knative/pkg/pulls/37","id":205884737,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA1ODg0NzM3","html_url":"https://github.com/knative/pkg/pull/37","diff_url":"https://github.com/knative/pkg/pull/37.diff","patch_url":"https://github.com/knative/pkg/pull/37.patch","issue_url":"https://api.github.com/repos/knative/pkg/issues/37","number":37,"state":"open","locked":false,"title":"Looking into Annotations on the Struct for validation.","user":{"login":"n3wscott","id":32305648,"node_id":"MDQ6VXNlcjMyMzA1NjQ4","avatar_url":"https://avatars3.githubusercontent.com/u/32305648?v=4","gravatar_id":"","url":"https://api.github.com/users/n3wscott","html_url":"https://github.com/n3wscott","followers_url":"https://api.github.com/users/n3wscott/followers","following_url":"https://api.github.com/users/n3wscott/following{/other_user}","gists_url":"https://api.github.com/users/n3wscott/gists{/gist_id}","starred_url":"https://api.github.com/users/n3wscott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/n3wscott/subscriptions","organizations_url":"https://api.github.com/users/n3wscott/orgs","repos_url":"https://api.github.com/users/n3wscott/repos","events_url":"https://api.github.com/users/n3wscott/events{/privacy}","received_events_url":"https://api.github.com/users/n3wscott/received_events","type":"User","site_admin":false},"body":"Here is the start of me looking at replacing some of the validation we do with annotations.\r\n\r\nPlease let me know if you like this direction of if I should stop.","created_at":"2018-08-02T23:03:53Z","updated_at":"2018-09-15T21:49:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1e8318779ade27b1b0065ea2ebf13afd87870a9e","assignee":{"login":"mattmoor","id":2442466,"node_id":"MDQ6VXNlcjI0NDI0NjY=","avatar_url":"https://avatars3.githubusercontent.com/u/2442466?v=4","gravatar_id":"","url":"https://api.github.com/users/mattmoor","html_url":"https://github.com/mattmoor","followers_url":"https://api.github.com/users/mattmoor/followers","following_url":"https://api.github.com/users/mattmoor/following{/other_user}","gists_url":"https://api.github.com/users/mattmoor/gists{/gist_id}","starred_url":"https://api.github.com/users/mattmoor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattmoor/subscriptions","organizations_url":"https://api.github.com/users/mattmoor/orgs","repos_url":"https://api.github.com/users/mattmoor/repos","events_url":"https://api.github.com/users/mattmoor/events{/privacy}","received_events_url":"https://api.github.com/users/mattmoor/received_events","type":"User","site_admin":false},"assignees":[{"login":"mattmoor","id":2442466,"node_id":"MDQ6VXNlcjI0NDI0NjY=","avatar_url":"https://avatars3.githubusercontent.com/u/2442466?v=4","gravatar_id":"","url":"https://api.github.com/users/mattmoor","html_url":"https://github.com/mattmoor","followers_url":"https://api.github.com/users/mattmoor/followers","following_url":"https://api.github.com/users/mattmoor/following{/other_user}","gists_url":"https://api.github.com/users/mattmoor/gists{/gist_id}","starred_url":"https://api.github.com/users/mattmoor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattmoor/subscriptions","organizations_url":"https://api.github.com/users/mattmoor/orgs","repos_url":"https://api.github.com/users/mattmoor/repos","events_url":"https://api.github.com/users/mattmoor/events{/privacy}","received_events_url":"https://api.github.com/users/mattmoor/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"evankanderson","id":7959095,"node_id":"MDQ6VXNlcjc5NTkwOTU=","avatar_url":"https://avatars2.githubusercontent.com/u/7959095?v=4","gravatar_id":"","url":"https://api.github.com/users/evankanderson","html_url":"https://github.com/evankanderson","followers_url":"https://api.github.com/users/evankanderson/followers","following_url":"https://api.github.com/users/evankanderson/following{/other_user}","gists_url":"https://api.github.com/users/evankanderson/gists{/gist_id}","starred_url":"https://api.github.com/users/evankanderson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evankanderson/subscriptions","organizations_url":"https://api.github.com/users/evankanderson/orgs","repos_url":"https://api.github.com/users/evankanderson/repos","events_url":"https://api.github.com/users/evankanderson/events{/privacy}","received_events_url":"https://api.github.com/users/evankanderson/received_events","type":"User","site_admin":false},{"login":"vaikas-google","id":11279988,"node_id":"MDQ6VXNlcjExMjc5OTg4","avatar_url":"https://avatars3.githubusercontent.com/u/11279988?v=4","gravatar_id":"","url":"https://api.github.com/users/vaikas-google","html_url":"https://github.com/vaikas-google","followers_url":"https://api.github.com/users/vaikas-google/followers","following_url":"https://api.github.com/users/vaikas-google/following{/other_user}","gists_url":"https://api.github.com/users/vaikas-google/gists{/gist_id}","starred_url":"https://api.github.com/users/vaikas-google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vaikas-google/subscriptions","organizations_url":"https://api.github.com/users/vaikas-google/orgs","repos_url":"https://api.github.com/users/vaikas-google/repos","events_url":"https://api.github.com/users/vaikas-google/events{/privacy}","received_events_url":"https://api.github.com/users/vaikas-google/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":1007315520,"node_id":"MDU6TGFiZWwxMDA3MzE1NTIw","url":"https://api.github.com/repos/knative/pkg/labels/size/L","name":"size/L","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/knative/pkg/pulls/37/commits","review_comments_url":"https://api.github.com/repos/knative/pkg/pulls/37/comments","review_comment_url":"https://api.github.com/repos/knative/pkg/pulls/comments{/number}","comments_url":"https://api.github.com/repos/knative/pkg/issues/37/comments","statuses_url":"https://api.github.com/repos/knative/pkg/statuses/3c01307addff024815b810c65e9e07e6d044f864","head":{"label":"n3wscott:validate-annotation","ref":"validate-annotation","sha":"3c01307addff024815b810c65e9e07e6d044f864","user":{"login":"n3wscott","id":32305648,"node_id":"MDQ6VXNlcjMyMzA1NjQ4","avatar_url":"https://avatars3.githubusercontent.com/u/32305648?v=4","gravatar_id":"","url":"https://api.github.com/users/n3wscott","html_url":"https://github.com/n3wscott","followers_url":"https://api.github.com/users/n3wscott/followers","following_url":"https://api.github.com/users/n3wscott/following{/other_user}","gists_url":"https://api.github.com/users/n3wscott/gists{/gist_id}","starred_url":"https://api.github.com/users/n3wscott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/n3wscott/subscriptions","organizations_url":"https://api.github.com/users/n3wscott/orgs","repos_url":"https://api.github.com/users/n3wscott/repos","events_url":"https://api.github.com/users/n3wscott/events{/privacy}","received_events_url":"https://api.github.com/users/n3wscott/received_events","type":"User","site_admin":false},"repo":{"id":142331531,"node_id":"MDEwOlJlcG9zaXRvcnkxNDIzMzE1MzE=","name":"pkg","full_name":"n3wscott/pkg","private":false,"owner":{"login":"n3wscott","id":32305648,"node_id":"MDQ6VXNlcjMyMzA1NjQ4","avatar_url":"https://avatars3.githubusercontent.com/u/32305648?v=4","gravatar_id":"","url":"https://api.github.com/users/n3wscott","html_url":"https://github.com/n3wscott","followers_url":"https://api.github.com/users/n3wscott/followers","following_url":"https://api.github.com/users/n3wscott/following{/other_user}","gists_url":"https://api.github.com/users/n3wscott/gists{/gist_id}","starred_url":"https://api.github.com/users/n3wscott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/n3wscott/subscriptions","organizations_url":"https://api.github.com/users/n3wscott/orgs","repos_url":"https://api.github.com/users/n3wscott/repos","events_url":"https://api.github.com/users/n3wscott/events{/privacy}","received_events_url":"https://api.github.com/users/n3wscott/received_events","type":"User","site_admin":false},"html_url":"https://github.com/n3wscott/pkg","description":"Knative common packages","fork":true,"url":"https://api.github.com/repos/n3wscott/pkg","forks_url":"https://api.github.com/repos/n3wscott/pkg/forks","keys_url":"https://api.github.com/repos/n3wscott/pkg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/n3wscott/pkg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/n3wscott/pkg/teams","hooks_url":"https://api.github.com/repos/n3wscott/pkg/hooks","issue_events_url":"https://api.github.com/repos/n3wscott/pkg/issues/events{/number}","events_url":"https://api.github.com/repos/n3wscott/pkg/events","assignees_url":"https://api.github.com/repos/n3wscott/pkg/assignees{/user}","branches_url":"https://api.github.com/repos/n3wscott/pkg/branches{/branch}","tags_url":"https://api.github.com/repos/n3wscott/pkg/tags","blobs_url":"https://api.github.com/repos/n3wscott/pkg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/n3wscott/pkg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/n3wscott/pkg/git/refs{/sha}","trees_url":"https://api.github.com/repos/n3wscott/pkg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/n3wscott/pkg/statuses/{sha}","languages_url":"https://api.github.com/repos/n3wscott/pkg/languages","stargazers_url":"https://api.github.com/repos/n3wscott/pkg/stargazers","contributors_url":"https://api.github.com/repos/n3wscott/pkg/contributors","subscribers_url":"https://api.github.com/repos/n3wscott/pkg/subscribers","subscription_url":"https://api.github.com/repos/n3wscott/pkg/subscription","commits_url":"https://api.github.com/repos/n3wscott/pkg/commits{/sha}","git_commits_url":"https://api.github.com/repos/n3wscott/pkg/git/commits{/sha}","comments_url":"https://api.github.com/repos/n3wscott/pkg/comments{/number}","issue_comment_url":"https://api.github.com/repos/n3wscott/pkg/issues/comments{/number}","contents_url":"https://api.github.com/repos/n3wscott/pkg/contents/{+path}","compare_url":"https://api.github.com/repos/n3wscott/pkg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/n3wscott/pkg/merges","archive_url":"https://api.github.com/repos/n3wscott/pkg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/n3wscott/pkg/downloads","issues_url":"https://api.github.com/repos/n3wscott/pkg/issues{/number}","pulls_url":"https://api.github.com/repos/n3wscott/pkg/pulls{/number}","milestones_url":"https://api.github.com/repos/n3wscott/pkg/milestones{/number}","notifications_url":"https://api.github.com/repos/n3wscott/pkg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/n3wscott/pkg/labels{/name}","releases_url":"https://api.github.com/repos/n3wscott/pkg/releases{/id}","deployments_url":"https://api.github.com/repos/n3wscott/pkg/deployments","created_at":"2018-07-25T17:19:35Z","updated_at":"2018-09-11T14:01:54Z","pushed_at":"2018-09-14T17:25:49Z","git_url":"git://github.com/n3wscott/pkg.git","ssh_url":"git@github.com:n3wscott/pkg.git","clone_url":"https://github.com/n3wscott/pkg.git","svn_url":"https://github.com/n3wscott/pkg","homepage":"","size":5122,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"knative:master","ref":"master","sha":"51828370417a6cce0cf7b271a5ee49bf3b01734c","user":{"login":"knative","id":35583233,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1NTgzMjMz","avatar_url":"https://avatars2.githubusercontent.com/u/35583233?v=4","gravatar_id":"","url":"https://api.github.com/users/knative","html_url":"https://github.com/knative","followers_url":"https://api.github.com/users/knative/followers","following_url":"https://api.github.com/users/knative/following{/other_user}","gists_url":"https://api.github.com/users/knative/gists{/gist_id}","starred_url":"https://api.github.com/users/knative/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knative/subscriptions","organizations_url":"https://api.github.com/users/knative/orgs","repos_url":"https://api.github.com/users/knative/repos","events_url":"https://api.github.com/users/knative/events{/privacy}","received_events_url":"https://api.github.com/users/knative/received_events","type":"Organization","site_admin":false},"repo":{"id":142331174,"node_id":"MDEwOlJlcG9zaXRvcnkxNDIzMzExNzQ=","name":"pkg","full_name":"knative/pkg","private":false,"owner":{"login":"knative","id":35583233,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1NTgzMjMz","avatar_url":"https://avatars2.githubusercontent.com/u/35583233?v=4","gravatar_id":"","url":"https://api.github.com/users/knative","html_url":"https://github.com/knative","followers_url":"https://api.github.com/users/knative/followers","following_url":"https://api.github.com/users/knative/following{/other_user}","gists_url":"https://api.github.com/users/knative/gists{/gist_id}","starred_url":"https://api.github.com/users/knative/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knative/subscriptions","organizations_url":"https://api.github.com/users/knative/orgs","repos_url":"https://api.github.com/users/knative/repos","events_url":"https://api.github.com/users/knative/events{/privacy}","received_events_url":"https://api.github.com/users/knative/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/knative/pkg","description":"Knative common packages","fork":false,"url":"https://api.github.com/repos/knative/pkg","forks_url":"https://api.github.com/repos/knative/pkg/forks","keys_url":"https://api.github.com/repos/knative/pkg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/knative/pkg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/knative/pkg/teams","hooks_url":"https://api.github.com/repos/knative/pkg/hooks","issue_events_url":"https://api.github.com/repos/knative/pkg/issues/events{/number}","events_url":"https://api.github.com/repos/knative/pkg/events","assignees_url":"https://api.github.com/repos/knative/pkg/assignees{/user}","branches_url":"https://api.github.com/repos/knative/pkg/branches{/branch}","tags_url":"https://api.github.com/repos/knative/pkg/tags","blobs_url":"https://api.github.com/repos/knative/pkg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/knative/pkg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/knative/pkg/git/refs{/sha}","trees_url":"https://api.github.com/repos/knative/pkg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/knative/pkg/statuses/{sha}","languages_url":"https://api.github.com/repos/knative/pkg/languages","stargazers_url":"https://api.github.com/repos/knative/pkg/stargazers","contributors_url":"https://api.github.com/repos/knative/pkg/contributors","subscribers_url":"https://api.github.com/repos/knative/pkg/subscribers","subscription_url":"https://api.github.com/repos/knative/pkg/subscription","commits_url":"https://api.github.com/repos/knative/pkg/commits{/sha}","git_commits_url":"https://api.github.com/repos/knative/pkg/git/commits{/sha}","comments_url":"https://api.github.com/repos/knative/pkg/comments{/number}","issue_comment_url":"https://api.github.com/repos/knative/pkg/issues/comments{/number}","contents_url":"https://api.github.com/repos/knative/pkg/contents/{+path}","compare_url":"https://api.github.com/repos/knative/pkg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/knative/pkg/merges","archive_url":"https://api.github.com/repos/knative/pkg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/knative/pkg/downloads","issues_url":"https://api.github.com/repos/knative/pkg/issues{/number}","pulls_url":"https://api.github.com/repos/knative/pkg/pulls{/number}","milestones_url":"https://api.github.com/repos/knative/pkg/milestones{/number}","notifications_url":"https://api.github.com/repos/knative/pkg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/knative/pkg/labels{/name}","releases_url":"https://api.github.com/repos/knative/pkg/releases{/id}","deployments_url":"https://api.github.com/repos/knative/pkg/deployments","created_at":"2018-07-25T17:16:04Z","updated_at":"2018-09-15T04:07:20Z","pushed_at":"2018-09-15T04:07:18Z","git_url":"git://github.com/knative/pkg.git","ssh_url":"git@github.com:knative/pkg.git","clone_url":"https://github.com/knative/pkg.git","svn_url":"https://github.com/knative/pkg","homepage":"","size":5107,"stargazers_count":13,"watchers_count":13,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":22,"mirror_url":null,"archived":false,"open_issues_count":9,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":22,"open_issues":9,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/knative/pkg/pulls/37"},"html":{"href":"https://github.com/knative/pkg/pull/37"},"issue":{"href":"https://api.github.com/repos/knative/pkg/issues/37"},"comments":{"href":"https://api.github.com/repos/knative/pkg/issues/37/comments"},"review_comments":{"href":"https://api.github.com/repos/knative/pkg/pulls/37/comments"},"review_comment":{"href":"https://api.github.com/repos/knative/pkg/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/knative/pkg/pulls/37/commits"},"statuses":{"href":"https://api.github.com/repos/knative/pkg/statuses/3c01307addff024815b810c65e9e07e6d044f864"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"ImJasonH"}}