{"action":"created","comment":{"url":"https://api.github.com/repos/openshift/library-go/pulls/comments/244832293","pull_request_review_id":188801044,"id":244832293,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0NDgzMjI5Mw==","diff_hunk":"@@ -0,0 +1,188 @@\n+package resourceapply\n+\n+import (\n+\t\"fmt\"\n+\n+\t\"github.com/ghodss/yaml\"\n+\t\"github.com/openshift/library-go/pkg/operator/resource/resourcemerge\"\n+\n+\t\"k8s.io/apimachinery/pkg/api/equality\"\n+\t\"k8s.io/apimachinery/pkg/api/errors\"\n+\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n+\t\"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured\"\n+\t\"k8s.io/apimachinery/pkg/runtime\"\n+\t\"k8s.io/apimachinery/pkg/runtime/schema\"\n+\t\"k8s.io/client-go/dynamic\"\n+\n+\t\"github.com/openshift/library-go/pkg/operator/events\"\n+)\n+\n+var serviceMonitorGVR = schema.GroupVersionResource{Group: \"monitoring.coreos.com\", Version: \"v1\", Resource: \"servicemonitors\"}\n+\n+func mergeUnstructuredSlice(required, existing []interface{}) ([]interface{}, bool, error) {","path":"pkg/operator/resource/resourceapply/monitoring.go","position":22,"original_position":22,"commit_id":"4eb4857d57837f9e5b2d268e8574bda716ca9524","original_commit_id":"4eb4857d57837f9e5b2d268e8574bda716ca9524","user":{"login":"sanchezl","id":5381811,"node_id":"MDQ6VXNlcjUzODE4MTE=","avatar_url":"https://avatars2.githubusercontent.com/u/5381811?v=4","gravatar_id":"","url":"https://api.github.com/users/sanchezl","html_url":"https://github.com/sanchezl","followers_url":"https://api.github.com/users/sanchezl/followers","following_url":"https://api.github.com/users/sanchezl/following{/other_user}","gists_url":"https://api.github.com/users/sanchezl/gists{/gist_id}","starred_url":"https://api.github.com/users/sanchezl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanchezl/subscriptions","organizations_url":"https://api.github.com/users/sanchezl/orgs","repos_url":"https://api.github.com/users/sanchezl/repos","events_url":"https://api.github.com/users/sanchezl/events{/privacy}","received_events_url":"https://api.github.com/users/sanchezl/received_events","type":"User","site_admin":false},"body":"mergo worked for me. The use of mergo got [moved into library-go](https://github.com/openshift/library-go/blob/ed90b992b08815b36c2b71c80218ea2135d8e4bd/pkg/operator/configobserver/config_observer_controller.go#L103).","created_at":"2019-01-02T19:38:08Z","updated_at":"2019-01-02T19:38:08Z","html_url":"https://github.com/openshift/library-go/pull/150#discussion_r244832293","pull_request_url":"https://api.github.com/repos/openshift/library-go/pulls/150","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/openshift/library-go/pulls/comments/244832293"},"html":{"href":"https://github.com/openshift/library-go/pull/150#discussion_r244832293"},"pull_request":{"href":"https://api.github.com/repos/openshift/library-go/pulls/150"}},"in_reply_to_id":244776271},"pull_request":{"url":"https://api.github.com/repos/openshift/library-go/pulls/150","id":241723366,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQxNzIzMzY2","html_url":"https://github.com/openshift/library-go/pull/150","diff_url":"https://github.com/openshift/library-go/pull/150.diff","patch_url":"https://github.com/openshift/library-go/pull/150.patch","issue_url":"https://api.github.com/repos/openshift/library-go/issues/150","number":150,"state":"open","locked":false,"title":"staticpod: add monitoring resources controller","user":{"login":"mfojtik","id":44136,"node_id":"MDQ6VXNlcjQ0MTM2","avatar_url":"https://avatars2.githubusercontent.com/u/44136?v=4","gravatar_id":"","url":"https://api.github.com/users/mfojtik","html_url":"https://github.com/mfojtik","followers_url":"https://api.github.com/users/mfojtik/followers","following_url":"https://api.github.com/users/mfojtik/following{/other_user}","gists_url":"https://api.github.com/users/mfojtik/gists{/gist_id}","starred_url":"https://api.github.com/users/mfojtik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfojtik/subscriptions","organizations_url":"https://api.github.com/users/mfojtik/orgs","repos_url":"https://api.github.com/users/mfojtik/repos","events_url":"https://api.github.com/users/mfojtik/events{/privacy}","received_events_url":"https://api.github.com/users/mfojtik/received_events","type":"User","site_admin":false},"body":"This change adds a controller loop that manages the lifecycle of resources needed to make service monitoring work. Making this generic means that all operator which currently use library-go will automatically get this.\r\n\r\nA non-generic attempt + history: https://github.com/openshift/cluster-kube-apiserver-operator/pull/172\r\n\r\n/cc @deads2k \r\n/cc @sttts ","created_at":"2019-01-02T11:19:51Z","updated_at":"2019-01-02T19:38:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f8ebe3ce187b7f48b999c81433f66ac4059e37b6","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":930105666,"node_id":"MDU6TGFiZWw5MzAxMDU2NjY=","url":"https://api.github.com/repos/openshift/library-go/labels/size/XL","name":"size/XL","color":"ee5500","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/openshift/library-go/pulls/150/commits","review_comments_url":"https://api.github.com/repos/openshift/library-go/pulls/150/comments","review_comment_url":"https://api.github.com/repos/openshift/library-go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openshift/library-go/issues/150/comments","statuses_url":"https://api.github.com/repos/openshift/library-go/statuses/4eb4857d57837f9e5b2d268e8574bda716ca9524","head":{"label":"mfojtik:service-monitor","ref":"service-monitor","sha":"4eb4857d57837f9e5b2d268e8574bda716ca9524","user":{"login":"mfojtik","id":44136,"node_id":"MDQ6VXNlcjQ0MTM2","avatar_url":"https://avatars2.githubusercontent.com/u/44136?v=4","gravatar_id":"","url":"https://api.github.com/users/mfojtik","html_url":"https://github.com/mfojtik","followers_url":"https://api.github.com/users/mfojtik/followers","following_url":"https://api.github.com/users/mfojtik/following{/other_user}","gists_url":"https://api.github.com/users/mfojtik/gists{/gist_id}","starred_url":"https://api.github.com/users/mfojtik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfojtik/subscriptions","organizations_url":"https://api.github.com/users/mfojtik/orgs","repos_url":"https://api.github.com/users/mfojtik/repos","events_url":"https://api.github.com/users/mfojtik/events{/privacy}","received_events_url":"https://api.github.com/users/mfojtik/received_events","type":"User","site_admin":false},"repo":{"id":133040210,"node_id":"MDEwOlJlcG9zaXRvcnkxMzMwNDAyMTA=","name":"library-go","full_name":"mfojtik/library-go","private":false,"owner":{"login":"mfojtik","id":44136,"node_id":"MDQ6VXNlcjQ0MTM2","avatar_url":"https://avatars2.githubusercontent.com/u/44136?v=4","gravatar_id":"","url":"https://api.github.com/users/mfojtik","html_url":"https://github.com/mfojtik","followers_url":"https://api.github.com/users/mfojtik/followers","following_url":"https://api.github.com/users/mfojtik/following{/other_user}","gists_url":"https://api.github.com/users/mfojtik/gists{/gist_id}","starred_url":"https://api.github.com/users/mfojtik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfojtik/subscriptions","organizations_url":"https://api.github.com/users/mfojtik/orgs","repos_url":"https://api.github.com/users/mfojtik/repos","events_url":"https://api.github.com/users/mfojtik/events{/privacy}","received_events_url":"https://api.github.com/users/mfojtik/received_events","type":"User","site_admin":false},"html_url":"https://github.com/mfojtik/library-go","description":"Helpers for going from apis and clients to useful runtime constructs","fork":true,"url":"https://api.github.com/repos/mfojtik/library-go","forks_url":"https://api.github.com/repos/mfojtik/library-go/forks","keys_url":"https://api.github.com/repos/mfojtik/library-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mfojtik/library-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mfojtik/library-go/teams","hooks_url":"https://api.github.com/repos/mfojtik/library-go/hooks","issue_events_url":"https://api.github.com/repos/mfojtik/library-go/issues/events{/number}","events_url":"https://api.github.com/repos/mfojtik/library-go/events","assignees_url":"https://api.github.com/repos/mfojtik/library-go/assignees{/user}","branches_url":"https://api.github.com/repos/mfojtik/library-go/branches{/branch}","tags_url":"https://api.github.com/repos/mfojtik/library-go/tags","blobs_url":"https://api.github.com/repos/mfojtik/library-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mfojtik/library-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mfojtik/library-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/mfojtik/library-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mfojtik/library-go/statuses/{sha}","languages_url":"https://api.github.com/repos/mfojtik/library-go/languages","stargazers_url":"https://api.github.com/repos/mfojtik/library-go/stargazers","contributors_url":"https://api.github.com/repos/mfojtik/library-go/contributors","subscribers_url":"https://api.github.com/repos/mfojtik/library-go/subscribers","subscription_url":"https://api.github.com/repos/mfojtik/library-go/subscription","commits_url":"https://api.github.com/repos/mfojtik/library-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/mfojtik/library-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/mfojtik/library-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/mfojtik/library-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/mfojtik/library-go/contents/{+path}","compare_url":"https://api.github.com/repos/mfojtik/library-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mfojtik/library-go/merges","archive_url":"https://api.github.com/repos/mfojtik/library-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mfojtik/library-go/downloads","issues_url":"https://api.github.com/repos/mfojtik/library-go/issues{/number}","pulls_url":"https://api.github.com/repos/mfojtik/library-go/pulls{/number}","milestones_url":"https://api.github.com/repos/mfojtik/library-go/milestones{/number}","notifications_url":"https://api.github.com/repos/mfojtik/library-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mfojtik/library-go/labels{/name}","releases_url":"https://api.github.com/repos/mfojtik/library-go/releases{/id}","deployments_url":"https://api.github.com/repos/mfojtik/library-go/deployments","created_at":"2018-05-11T13:01:07Z","updated_at":"2019-01-02T11:17:22Z","pushed_at":"2019-01-02T15:54:22Z","git_url":"git://github.com/mfojtik/library-go.git","ssh_url":"git@github.com:mfojtik/library-go.git","clone_url":"https://github.com/mfojtik/library-go.git","svn_url":"https://github.com/mfojtik/library-go","homepage":null,"size":20748,"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":"openshift:master","ref":"master","sha":"ed90b992b08815b36c2b71c80218ea2135d8e4bd","user":{"login":"openshift","id":792337,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc5MjMzNw==","avatar_url":"https://avatars3.githubusercontent.com/u/792337?v=4","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"repo":{"id":132917906,"node_id":"MDEwOlJlcG9zaXRvcnkxMzI5MTc5MDY=","name":"library-go","full_name":"openshift/library-go","private":false,"owner":{"login":"openshift","id":792337,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc5MjMzNw==","avatar_url":"https://avatars3.githubusercontent.com/u/792337?v=4","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/openshift/library-go","description":"Helpers for going from apis and clients to useful runtime constructs","fork":false,"url":"https://api.github.com/repos/openshift/library-go","forks_url":"https://api.github.com/repos/openshift/library-go/forks","keys_url":"https://api.github.com/repos/openshift/library-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openshift/library-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openshift/library-go/teams","hooks_url":"https://api.github.com/repos/openshift/library-go/hooks","issue_events_url":"https://api.github.com/repos/openshift/library-go/issues/events{/number}","events_url":"https://api.github.com/repos/openshift/library-go/events","assignees_url":"https://api.github.com/repos/openshift/library-go/assignees{/user}","branches_url":"https://api.github.com/repos/openshift/library-go/branches{/branch}","tags_url":"https://api.github.com/repos/openshift/library-go/tags","blobs_url":"https://api.github.com/repos/openshift/library-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openshift/library-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openshift/library-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/openshift/library-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openshift/library-go/statuses/{sha}","languages_url":"https://api.github.com/repos/openshift/library-go/languages","stargazers_url":"https://api.github.com/repos/openshift/library-go/stargazers","contributors_url":"https://api.github.com/repos/openshift/library-go/contributors","subscribers_url":"https://api.github.com/repos/openshift/library-go/subscribers","subscription_url":"https://api.github.com/repos/openshift/library-go/subscription","commits_url":"https://api.github.com/repos/openshift/library-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/openshift/library-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/openshift/library-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/openshift/library-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/openshift/library-go/contents/{+path}","compare_url":"https://api.github.com/repos/openshift/library-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openshift/library-go/merges","archive_url":"https://api.github.com/repos/openshift/library-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openshift/library-go/downloads","issues_url":"https://api.github.com/repos/openshift/library-go/issues{/number}","pulls_url":"https://api.github.com/repos/openshift/library-go/pulls{/number}","milestones_url":"https://api.github.com/repos/openshift/library-go/milestones{/number}","notifications_url":"https://api.github.com/repos/openshift/library-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openshift/library-go/labels{/name}","releases_url":"https://api.github.com/repos/openshift/library-go/releases{/id}","deployments_url":"https://api.github.com/repos/openshift/library-go/deployments","created_at":"2018-05-10T15:14:38Z","updated_at":"2019-01-02T15:17:04Z","pushed_at":"2019-01-02T17:00:01Z","git_url":"git://github.com/openshift/library-go.git","ssh_url":"git@github.com:openshift/library-go.git","clone_url":"https://github.com/openshift/library-go.git","svn_url":"https://github.com/openshift/library-go","homepage":null,"size":20704,"stargazers_count":11,"watchers_count":11,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":19,"mirror_url":null,"archived":false,"open_issues_count":10,"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":19,"open_issues":10,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openshift/library-go/pulls/150"},"html":{"href":"https://github.com/openshift/library-go/pull/150"},"issue":{"href":"https://api.github.com/repos/openshift/library-go/issues/150"},"comments":{"href":"https://api.github.com/repos/openshift/library-go/issues/150/comments"},"review_comments":{"href":"https://api.github.com/repos/openshift/library-go/pulls/150/comments"},"review_comment":{"href":"https://api.github.com/repos/openshift/library-go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openshift/library-go/pulls/150/commits"},"statuses":{"href":"https://api.github.com/repos/openshift/library-go/statuses/4eb4857d57837f9e5b2d268e8574bda716ca9524"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"sanchezl"}}