{"action":"created","comment":{"url":"https://api.github.com/repos/jetstack/cert-manager/pulls/comments/173882419","pull_request_review_id":103144829,"id":173882419,"diff_hunk":"@@ -218,6 +224,16 @@ func (c *Controller) updateSecret(name, namespace string, cert, key []byte) (*ap\n \t}\n \tsecret.Data[api.TLSCertKey] = cert\n \tsecret.Data[api.TLSPrivateKeyKey] = key\n+\n+\tif secret.Annotations == nil {\n+\t\tsecret.Annotations = make(map[string]string)\n+\t}\n+\n+\tsecret.Annotations[altNamesAnnotation] = strings.Join(spec.DNSNames, \",\")\n+\tsecret.Annotations[commonNameAnnotation] = spec.CommonName","path":"pkg/controller/certificates/sync.go","position":49,"original_position":49,"commit_id":"f6210c12c627155a580ce21f041b81e610e3051a","original_commit_id":"f6210c12c627155a580ce21f041b81e610e3051a","user":{"login":"munnerz","id":203583,"avatar_url":"https://avatars3.githubusercontent.com/u/203583?v=4","gravatar_id":"","url":"https://api.github.com/users/munnerz","html_url":"https://github.com/munnerz","followers_url":"https://api.github.com/users/munnerz/followers","following_url":"https://api.github.com/users/munnerz/following{/other_user}","gists_url":"https://api.github.com/users/munnerz/gists{/gist_id}","starred_url":"https://api.github.com/users/munnerz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/munnerz/subscriptions","organizations_url":"https://api.github.com/users/munnerz/orgs","repos_url":"https://api.github.com/users/munnerz/repos","events_url":"https://api.github.com/users/munnerz/events{/privacy}","received_events_url":"https://api.github.com/users/munnerz/received_events","type":"User","site_admin":false},"body":"We shouldn't directly copy these values from the Certificate resource - they default in peculiar ways (see here: https://github.com/kragniz/cert-manager/blob/f6210c12c627155a580ce21f041b81e610e3051a/pkg/controller/certificates/sync.go#L100-L107)\r\n","created_at":"2018-03-12T17:32:27Z","updated_at":"2018-03-12T17:33:12Z","html_url":"https://github.com/jetstack/cert-manager/pull/388#discussion_r173882419","pull_request_url":"https://api.github.com/repos/jetstack/cert-manager/pulls/388","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/jetstack/cert-manager/pulls/comments/173882419"},"html":{"href":"https://github.com/jetstack/cert-manager/pull/388#discussion_r173882419"},"pull_request":{"href":"https://api.github.com/repos/jetstack/cert-manager/pulls/388"}}},"pull_request":{"url":"https://api.github.com/repos/jetstack/cert-manager/pulls/388","id":174399014,"html_url":"https://github.com/jetstack/cert-manager/pull/388","diff_url":"https://github.com/jetstack/cert-manager/pull/388.diff","patch_url":"https://github.com/jetstack/cert-manager/pull/388.patch","issue_url":"https://api.github.com/repos/jetstack/cert-manager/issues/388","number":388,"state":"open","locked":false,"title":"Annotate created secrets with cert information","user":{"login":"kragniz","id":735008,"avatar_url":"https://avatars2.githubusercontent.com/u/735008?v=4","gravatar_id":"","url":"https://api.github.com/users/kragniz","html_url":"https://github.com/kragniz","followers_url":"https://api.github.com/users/kragniz/followers","following_url":"https://api.github.com/users/kragniz/following{/other_user}","gists_url":"https://api.github.com/users/kragniz/gists{/gist_id}","starred_url":"https://api.github.com/users/kragniz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kragniz/subscriptions","organizations_url":"https://api.github.com/users/kragniz/orgs","repos_url":"https://api.github.com/users/kragniz/repos","events_url":"https://api.github.com/users/kragniz/events{/privacy}","received_events_url":"https://api.github.com/users/kragniz/received_events","type":"User","site_admin":false},"body":"<!--  Thanks for sending a pull request!  Here are some tips for you:\r\n1. If this is your first time, read our contributor guidelines https://git.k8s.io/community/contributors/devel/pull-requests.md#the-pr-submit-process and developer guide https://git.k8s.io/community/contributors/devel/development.md#development-guide\r\n2. If you want *faster* PR reviews, read how: https://git.k8s.io/community/contributors/devel/pull-requests.md#best-practices-for-faster-reviews\r\n3. Follow the instructions for writing a release note: https://git.k8s.io/community/contributors/devel/pull-requests.md#write-release-notes-if-needed\r\n-->\r\n\r\n**What this PR does / why we need it**: Previously, it was hard to inspect why a secret was created. This adds additional information in the form of annotations which should help keep track of created secrets.\r\n\r\n**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #262 \r\n\r\n**Release note**:\r\n<!--  Steps to write your release note:\r\n1. Use the release-note-* labels to set the release note state (if you have access)\r\n2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`.\r\n-->\r\n```release-note\r\nTLS secrets are now annotated with information about the certificate\r\n```\r\n","created_at":"2018-03-12T15:12:36Z","updated_at":"2018-03-12T17:33:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4997c93359f90f3a5b0a99a1aa9924aa8fbab946","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":727722560,"url":"https://api.github.com/repos/jetstack/cert-manager/labels/release-note","name":"release-note","color":"c2e0c6","default":false},{"id":728648139,"url":"https://api.github.com/repos/jetstack/cert-manager/labels/size/S","name":"size/S","color":"77bb00","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/jetstack/cert-manager/pulls/388/commits","review_comments_url":"https://api.github.com/repos/jetstack/cert-manager/pulls/388/comments","review_comment_url":"https://api.github.com/repos/jetstack/cert-manager/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jetstack/cert-manager/issues/388/comments","statuses_url":"https://api.github.com/repos/jetstack/cert-manager/statuses/f6210c12c627155a580ce21f041b81e610e3051a","head":{"label":"kragniz:secret-annotations","ref":"secret-annotations","sha":"f6210c12c627155a580ce21f041b81e610e3051a","user":{"login":"kragniz","id":735008,"avatar_url":"https://avatars2.githubusercontent.com/u/735008?v=4","gravatar_id":"","url":"https://api.github.com/users/kragniz","html_url":"https://github.com/kragniz","followers_url":"https://api.github.com/users/kragniz/followers","following_url":"https://api.github.com/users/kragniz/following{/other_user}","gists_url":"https://api.github.com/users/kragniz/gists{/gist_id}","starred_url":"https://api.github.com/users/kragniz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kragniz/subscriptions","organizations_url":"https://api.github.com/users/kragniz/orgs","repos_url":"https://api.github.com/users/kragniz/repos","events_url":"https://api.github.com/users/kragniz/events{/privacy}","received_events_url":"https://api.github.com/users/kragniz/received_events","type":"User","site_admin":false},"repo":{"id":124390802,"name":"cert-manager","full_name":"kragniz/cert-manager","owner":{"login":"kragniz","id":735008,"avatar_url":"https://avatars2.githubusercontent.com/u/735008?v=4","gravatar_id":"","url":"https://api.github.com/users/kragniz","html_url":"https://github.com/kragniz","followers_url":"https://api.github.com/users/kragniz/followers","following_url":"https://api.github.com/users/kragniz/following{/other_user}","gists_url":"https://api.github.com/users/kragniz/gists{/gist_id}","starred_url":"https://api.github.com/users/kragniz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kragniz/subscriptions","organizations_url":"https://api.github.com/users/kragniz/orgs","repos_url":"https://api.github.com/users/kragniz/repos","events_url":"https://api.github.com/users/kragniz/events{/privacy}","received_events_url":"https://api.github.com/users/kragniz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kragniz/cert-manager","description":"Automatically provision and manage TLS certificates in Kubernetes","fork":true,"url":"https://api.github.com/repos/kragniz/cert-manager","forks_url":"https://api.github.com/repos/kragniz/cert-manager/forks","keys_url":"https://api.github.com/repos/kragniz/cert-manager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kragniz/cert-manager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kragniz/cert-manager/teams","hooks_url":"https://api.github.com/repos/kragniz/cert-manager/hooks","issue_events_url":"https://api.github.com/repos/kragniz/cert-manager/issues/events{/number}","events_url":"https://api.github.com/repos/kragniz/cert-manager/events","assignees_url":"https://api.github.com/repos/kragniz/cert-manager/assignees{/user}","branches_url":"https://api.github.com/repos/kragniz/cert-manager/branches{/branch}","tags_url":"https://api.github.com/repos/kragniz/cert-manager/tags","blobs_url":"https://api.github.com/repos/kragniz/cert-manager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kragniz/cert-manager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kragniz/cert-manager/git/refs{/sha}","trees_url":"https://api.github.com/repos/kragniz/cert-manager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kragniz/cert-manager/statuses/{sha}","languages_url":"https://api.github.com/repos/kragniz/cert-manager/languages","stargazers_url":"https://api.github.com/repos/kragniz/cert-manager/stargazers","contributors_url":"https://api.github.com/repos/kragniz/cert-manager/contributors","subscribers_url":"https://api.github.com/repos/kragniz/cert-manager/subscribers","subscription_url":"https://api.github.com/repos/kragniz/cert-manager/subscription","commits_url":"https://api.github.com/repos/kragniz/cert-manager/commits{/sha}","git_commits_url":"https://api.github.com/repos/kragniz/cert-manager/git/commits{/sha}","comments_url":"https://api.github.com/repos/kragniz/cert-manager/comments{/number}","issue_comment_url":"https://api.github.com/repos/kragniz/cert-manager/issues/comments{/number}","contents_url":"https://api.github.com/repos/kragniz/cert-manager/contents/{+path}","compare_url":"https://api.github.com/repos/kragniz/cert-manager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kragniz/cert-manager/merges","archive_url":"https://api.github.com/repos/kragniz/cert-manager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kragniz/cert-manager/downloads","issues_url":"https://api.github.com/repos/kragniz/cert-manager/issues{/number}","pulls_url":"https://api.github.com/repos/kragniz/cert-manager/pulls{/number}","milestones_url":"https://api.github.com/repos/kragniz/cert-manager/milestones{/number}","notifications_url":"https://api.github.com/repos/kragniz/cert-manager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kragniz/cert-manager/labels{/name}","releases_url":"https://api.github.com/repos/kragniz/cert-manager/releases{/id}","deployments_url":"https://api.github.com/repos/kragniz/cert-manager/deployments","created_at":"2018-03-08T12:50:21Z","updated_at":"2018-03-08T12:50:24Z","pushed_at":"2018-03-12T15:08:34Z","git_url":"git://github.com/kragniz/cert-manager.git","ssh_url":"git@github.com:kragniz/cert-manager.git","clone_url":"https://github.com/kragniz/cert-manager.git","svn_url":"https://github.com/kragniz/cert-manager","homepage":"","size":51168,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"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"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jetstack:master","ref":"master","sha":"cfa13a02df872f934a13f3b12d2f72f02a641f48","user":{"login":"jetstack","id":13183983,"avatar_url":"https://avatars1.githubusercontent.com/u/13183983?v=4","gravatar_id":"","url":"https://api.github.com/users/jetstack","html_url":"https://github.com/jetstack","followers_url":"https://api.github.com/users/jetstack/followers","following_url":"https://api.github.com/users/jetstack/following{/other_user}","gists_url":"https://api.github.com/users/jetstack/gists{/gist_id}","starred_url":"https://api.github.com/users/jetstack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jetstack/subscriptions","organizations_url":"https://api.github.com/users/jetstack/orgs","repos_url":"https://api.github.com/users/jetstack/repos","events_url":"https://api.github.com/users/jetstack/events{/privacy}","received_events_url":"https://api.github.com/users/jetstack/received_events","type":"Organization","site_admin":false},"repo":{"id":92313258,"name":"cert-manager","full_name":"jetstack/cert-manager","owner":{"login":"jetstack","id":13183983,"avatar_url":"https://avatars1.githubusercontent.com/u/13183983?v=4","gravatar_id":"","url":"https://api.github.com/users/jetstack","html_url":"https://github.com/jetstack","followers_url":"https://api.github.com/users/jetstack/followers","following_url":"https://api.github.com/users/jetstack/following{/other_user}","gists_url":"https://api.github.com/users/jetstack/gists{/gist_id}","starred_url":"https://api.github.com/users/jetstack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jetstack/subscriptions","organizations_url":"https://api.github.com/users/jetstack/orgs","repos_url":"https://api.github.com/users/jetstack/repos","events_url":"https://api.github.com/users/jetstack/events{/privacy}","received_events_url":"https://api.github.com/users/jetstack/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jetstack/cert-manager","description":"Automatically provision and manage TLS certificates in Kubernetes","fork":false,"url":"https://api.github.com/repos/jetstack/cert-manager","forks_url":"https://api.github.com/repos/jetstack/cert-manager/forks","keys_url":"https://api.github.com/repos/jetstack/cert-manager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jetstack/cert-manager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jetstack/cert-manager/teams","hooks_url":"https://api.github.com/repos/jetstack/cert-manager/hooks","issue_events_url":"https://api.github.com/repos/jetstack/cert-manager/issues/events{/number}","events_url":"https://api.github.com/repos/jetstack/cert-manager/events","assignees_url":"https://api.github.com/repos/jetstack/cert-manager/assignees{/user}","branches_url":"https://api.github.com/repos/jetstack/cert-manager/branches{/branch}","tags_url":"https://api.github.com/repos/jetstack/cert-manager/tags","blobs_url":"https://api.github.com/repos/jetstack/cert-manager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jetstack/cert-manager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jetstack/cert-manager/git/refs{/sha}","trees_url":"https://api.github.com/repos/jetstack/cert-manager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jetstack/cert-manager/statuses/{sha}","languages_url":"https://api.github.com/repos/jetstack/cert-manager/languages","stargazers_url":"https://api.github.com/repos/jetstack/cert-manager/stargazers","contributors_url":"https://api.github.com/repos/jetstack/cert-manager/contributors","subscribers_url":"https://api.github.com/repos/jetstack/cert-manager/subscribers","subscription_url":"https://api.github.com/repos/jetstack/cert-manager/subscription","commits_url":"https://api.github.com/repos/jetstack/cert-manager/commits{/sha}","git_commits_url":"https://api.github.com/repos/jetstack/cert-manager/git/commits{/sha}","comments_url":"https://api.github.com/repos/jetstack/cert-manager/comments{/number}","issue_comment_url":"https://api.github.com/repos/jetstack/cert-manager/issues/comments{/number}","contents_url":"https://api.github.com/repos/jetstack/cert-manager/contents/{+path}","compare_url":"https://api.github.com/repos/jetstack/cert-manager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jetstack/cert-manager/merges","archive_url":"https://api.github.com/repos/jetstack/cert-manager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jetstack/cert-manager/downloads","issues_url":"https://api.github.com/repos/jetstack/cert-manager/issues{/number}","pulls_url":"https://api.github.com/repos/jetstack/cert-manager/pulls{/number}","milestones_url":"https://api.github.com/repos/jetstack/cert-manager/milestones{/number}","notifications_url":"https://api.github.com/repos/jetstack/cert-manager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jetstack/cert-manager/labels{/name}","releases_url":"https://api.github.com/repos/jetstack/cert-manager/releases{/id}","deployments_url":"https://api.github.com/repos/jetstack/cert-manager/deployments","created_at":"2017-05-24T16:25:59Z","updated_at":"2018-03-12T17:23:50Z","pushed_at":"2018-03-12T17:25:43Z","git_url":"git://github.com/jetstack/cert-manager.git","ssh_url":"git@github.com:jetstack/cert-manager.git","clone_url":"https://github.com/jetstack/cert-manager.git","svn_url":"https://github.com/jetstack/cert-manager","homepage":"","size":51170,"stargazers_count":601,"watchers_count":601,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":83,"mirror_url":null,"archived":false,"open_issues_count":105,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":83,"open_issues":105,"watchers":601,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jetstack/cert-manager/pulls/388"},"html":{"href":"https://github.com/jetstack/cert-manager/pull/388"},"issue":{"href":"https://api.github.com/repos/jetstack/cert-manager/issues/388"},"comments":{"href":"https://api.github.com/repos/jetstack/cert-manager/issues/388/comments"},"review_comments":{"href":"https://api.github.com/repos/jetstack/cert-manager/pulls/388/comments"},"review_comment":{"href":"https://api.github.com/repos/jetstack/cert-manager/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jetstack/cert-manager/pulls/388/commits"},"statuses":{"href":"https://api.github.com/repos/jetstack/cert-manager/statuses/f6210c12c627155a580ce21f041b81e610e3051a"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"munnerz"}}