{"action":"created","comment":{"url":"https://api.github.com/repos/heptio/sonobuoy/pulls/comments/155929351","pull_request_review_id":82331839,"id":155929351,"diff_hunk":"@@ -0,0 +1,170 @@\n+# Sonobuoy Tarball Client\n+\n+## Table of Contents\n+\n+* [Summary](#summary)\n+* [Objectives](#objectives)\n+  * [Goals](#goals)\n+  * [Non-Goals](#non-goals)\n+* [Proposal](#proposal)\n+  * [User Stories](#user-stories)\n+* [Unresolved Questions](#unresolved-questions)\n+\n+## Summary\n+\n+Sonobuoy delivers results in a gzipped tar archive. The structure of the tar\n+is [documented here][tar structure] but programmatic access is up to every\n+consumer to implement. The structure of the tarball can change between\n+versions and consumer implementations become fragile.\n+\n+This proposal aims to describe an API for a client that can consumers can use\n+to extract data from a Sonobuoy tarball.\n+\n+## Objectives\n+\n+Provide a friendly API for easy access to data found in Sonobuoy Tarballs\n+across versions. Users should already be fairly familiar with the API below\n+as it might look a lot like client-go. Instead of querying an API server we\n+are querying a Sonobuoy tarball.\n+\n+### Goals\n+\n+ - Define and implement an API to access files in a Sonobuoy tarball.\n+ - Support all tarball versions starting at v0.9.0.\n+ - Have a familiar API.\n+\n+### Non-Goals\n+\n+- We will be unable to customize the tarball for every plugin as people can\n+write custom plugins. However, there should be an easy way for folks to get\n+their results using this client. The main feature we are supporting is access\n+to the core data generated by the [Sonobuoy queries][queries].\n+- There will be no support for tarballs before Sonobuoy version 0.9.0.\n+\n+## Proposal\n+\n+```go\n+type Tarball interface {\n+    // Sonobuoy dumps stuff out that can be queried throught the k8s interface.\n+    // The source will be a tarball instead of a k8s server.\n+    Resources() kubernetes.Interface\n+\n+    // These are all the extra things that Sonobuoy picks up.\n+    Hosts() []*Host\n+    Metadata() *Metadata\n+    Plugins() []*Plugin\n+    PodLogs() []*PodLog\n+    ServerVersion() *version.Info\n+}\n+\n+// Host contains the metadata for a given host in a Kubernetes cluster.\n+type Host struct {\n+    // Name is the name of the host.\n+    Name string\n+    // Configz is the result of the configz endpoint.\n+    KubeletConfig map[string]interface{}\n+    // StatusCode is the result of the healthz endpoint for the node.\n+    StatusCode int\n+}\n+\n+// Metadata is all the stuff about the Sonobuoy run and how long it took to query the system.\n+type Metadata struct {\n+    // Config is the config used during this Sonobuoy run.\n+    Config sonobuoy.Config\n+    // QueryInfos shows how long each object took to query.\n+    QueryInfos []*sonobuoy.QueryInfo\n+}\n+\n+// Plugin is a single plugin that executed during a Sonobuoy run.\n+type Plugin struct {\n+    // Name is the name of the plugin.\n+    Name string\n+    // Results is a map of plugin result filenames to the file contents.\n+    Results map[string][]byte\n+}\n+\n+// PodLog are all the logs gathered from an individual pod.\n+type PodLog struct {\n+    // Name is the name of the pod.\n+    Name string\n+    // Logs are the logs in io.Reader form because they can be quite large.\n+    Logs io.Reader\n+}\n+```\n+\n+Some sample code using this interface:\n+\n+```go\n+data, _ := ioutil.ReadFile(\"sonobuoy.tar.gz\")\n+tarballClient := sonobuoy.NewTarball(data)\n+\n+// Getting resources (namespaced or not) should be really familiar.\n+_ := tarballClient.Resources().Core().Nodes()","path":"docs/enhancements/sep-tarball-client.md","position":102,"original_position":102,"commit_id":"5f50b4e5b5fc78af3254ed9e076d18af3f7c78ec","original_commit_id":"5f50b4e5b5fc78af3254ed9e076d18af3f7c78ec","user":{"login":"timothysc","id":169553,"avatar_url":"https://avatars0.githubusercontent.com/u/169553?v=4","gravatar_id":"","url":"https://api.github.com/users/timothysc","html_url":"https://github.com/timothysc","followers_url":"https://api.github.com/users/timothysc/followers","following_url":"https://api.github.com/users/timothysc/following{/other_user}","gists_url":"https://api.github.com/users/timothysc/gists{/gist_id}","starred_url":"https://api.github.com/users/timothysc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timothysc/subscriptions","organizations_url":"https://api.github.com/users/timothysc/orgs","repos_url":"https://api.github.com/users/timothysc/repos","events_url":"https://api.github.com/users/timothysc/events{/privacy}","received_events_url":"https://api.github.com/users/timothysc/received_events","type":"User","site_admin":false},"body":"I don't think we need to follow api conventions here.  There are cluster scoped and NS-scoped resources, it's much more akin to how RBAC's interface.  ","created_at":"2017-12-09T18:45:45Z","updated_at":"2017-12-09T18:48:12Z","html_url":"https://github.com/heptio/sonobuoy/pull/164#discussion_r155929351","pull_request_url":"https://api.github.com/repos/heptio/sonobuoy/pulls/164","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/heptio/sonobuoy/pulls/comments/155929351"},"html":{"href":"https://github.com/heptio/sonobuoy/pull/164#discussion_r155929351"},"pull_request":{"href":"https://api.github.com/repos/heptio/sonobuoy/pulls/164"}}},"pull_request":{"url":"https://api.github.com/repos/heptio/sonobuoy/pulls/164","id":155760831,"html_url":"https://github.com/heptio/sonobuoy/pull/164","diff_url":"https://github.com/heptio/sonobuoy/pull/164.diff","patch_url":"https://github.com/heptio/sonobuoy/pull/164.patch","issue_url":"https://api.github.com/repos/heptio/sonobuoy/issues/164","number":164,"state":"open","locked":false,"title":"Adds a sonobuoy enhancement proposal","user":{"login":"chuckha","id":98927,"avatar_url":"https://avatars0.githubusercontent.com/u/98927?v=4","gravatar_id":"","url":"https://api.github.com/users/chuckha","html_url":"https://github.com/chuckha","followers_url":"https://api.github.com/users/chuckha/followers","following_url":"https://api.github.com/users/chuckha/following{/other_user}","gists_url":"https://api.github.com/users/chuckha/gists{/gist_id}","starred_url":"https://api.github.com/users/chuckha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chuckha/subscriptions","organizations_url":"https://api.github.com/users/chuckha/orgs","repos_url":"https://api.github.com/users/chuckha/repos","events_url":"https://api.github.com/users/chuckha/events{/privacy}","received_events_url":"https://api.github.com/users/chuckha/received_events","type":"User","site_admin":false},"body":"Looking forward to feedback. I think this is going to be pretty neat.\r\n\r\nSigned-off-by: Chuck Ha <chuck@heptio.com>","created_at":"2017-12-01T01:15:51Z","updated_at":"2017-12-09T18:48:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"38e0e93809319d678db432982d51c7b4c6f4636e","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/heptio/sonobuoy/pulls/164/commits","review_comments_url":"https://api.github.com/repos/heptio/sonobuoy/pulls/164/comments","review_comment_url":"https://api.github.com/repos/heptio/sonobuoy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/heptio/sonobuoy/issues/164/comments","statuses_url":"https://api.github.com/repos/heptio/sonobuoy/statuses/5f50b4e5b5fc78af3254ed9e076d18af3f7c78ec","head":{"label":"chuckha:sep-1","ref":"sep-1","sha":"5f50b4e5b5fc78af3254ed9e076d18af3f7c78ec","user":{"login":"chuckha","id":98927,"avatar_url":"https://avatars0.githubusercontent.com/u/98927?v=4","gravatar_id":"","url":"https://api.github.com/users/chuckha","html_url":"https://github.com/chuckha","followers_url":"https://api.github.com/users/chuckha/followers","following_url":"https://api.github.com/users/chuckha/following{/other_user}","gists_url":"https://api.github.com/users/chuckha/gists{/gist_id}","starred_url":"https://api.github.com/users/chuckha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chuckha/subscriptions","organizations_url":"https://api.github.com/users/chuckha/orgs","repos_url":"https://api.github.com/users/chuckha/repos","events_url":"https://api.github.com/users/chuckha/events{/privacy}","received_events_url":"https://api.github.com/users/chuckha/received_events","type":"User","site_admin":false},"repo":{"id":100302695,"name":"sonobuoy","full_name":"chuckha/sonobuoy","owner":{"login":"chuckha","id":98927,"avatar_url":"https://avatars0.githubusercontent.com/u/98927?v=4","gravatar_id":"","url":"https://api.github.com/users/chuckha","html_url":"https://github.com/chuckha","followers_url":"https://api.github.com/users/chuckha/followers","following_url":"https://api.github.com/users/chuckha/following{/other_user}","gists_url":"https://api.github.com/users/chuckha/gists{/gist_id}","starred_url":"https://api.github.com/users/chuckha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chuckha/subscriptions","organizations_url":"https://api.github.com/users/chuckha/orgs","repos_url":"https://api.github.com/users/chuckha/repos","events_url":"https://api.github.com/users/chuckha/events{/privacy}","received_events_url":"https://api.github.com/users/chuckha/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chuckha/sonobuoy","description":"Heptio Sonobuoy is a diagnostic tool that makes it easier to understand the state of a Kubernetes cluster by running a set of Kubernetes conformance tests in an accessible and non-destructive manner. Brought to you by Heptio.","fork":true,"url":"https://api.github.com/repos/chuckha/sonobuoy","forks_url":"https://api.github.com/repos/chuckha/sonobuoy/forks","keys_url":"https://api.github.com/repos/chuckha/sonobuoy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chuckha/sonobuoy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chuckha/sonobuoy/teams","hooks_url":"https://api.github.com/repos/chuckha/sonobuoy/hooks","issue_events_url":"https://api.github.com/repos/chuckha/sonobuoy/issues/events{/number}","events_url":"https://api.github.com/repos/chuckha/sonobuoy/events","assignees_url":"https://api.github.com/repos/chuckha/sonobuoy/assignees{/user}","branches_url":"https://api.github.com/repos/chuckha/sonobuoy/branches{/branch}","tags_url":"https://api.github.com/repos/chuckha/sonobuoy/tags","blobs_url":"https://api.github.com/repos/chuckha/sonobuoy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chuckha/sonobuoy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chuckha/sonobuoy/git/refs{/sha}","trees_url":"https://api.github.com/repos/chuckha/sonobuoy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chuckha/sonobuoy/statuses/{sha}","languages_url":"https://api.github.com/repos/chuckha/sonobuoy/languages","stargazers_url":"https://api.github.com/repos/chuckha/sonobuoy/stargazers","contributors_url":"https://api.github.com/repos/chuckha/sonobuoy/contributors","subscribers_url":"https://api.github.com/repos/chuckha/sonobuoy/subscribers","subscription_url":"https://api.github.com/repos/chuckha/sonobuoy/subscription","commits_url":"https://api.github.com/repos/chuckha/sonobuoy/commits{/sha}","git_commits_url":"https://api.github.com/repos/chuckha/sonobuoy/git/commits{/sha}","comments_url":"https://api.github.com/repos/chuckha/sonobuoy/comments{/number}","issue_comment_url":"https://api.github.com/repos/chuckha/sonobuoy/issues/comments{/number}","contents_url":"https://api.github.com/repos/chuckha/sonobuoy/contents/{+path}","compare_url":"https://api.github.com/repos/chuckha/sonobuoy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chuckha/sonobuoy/merges","archive_url":"https://api.github.com/repos/chuckha/sonobuoy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chuckha/sonobuoy/downloads","issues_url":"https://api.github.com/repos/chuckha/sonobuoy/issues{/number}","pulls_url":"https://api.github.com/repos/chuckha/sonobuoy/pulls{/number}","milestones_url":"https://api.github.com/repos/chuckha/sonobuoy/milestones{/number}","notifications_url":"https://api.github.com/repos/chuckha/sonobuoy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chuckha/sonobuoy/labels{/name}","releases_url":"https://api.github.com/repos/chuckha/sonobuoy/releases{/id}","deployments_url":"https://api.github.com/repos/chuckha/sonobuoy/deployments","created_at":"2017-08-14T19:33:20Z","updated_at":"2017-08-14T19:33:22Z","pushed_at":"2017-12-01T01:15:21Z","git_url":"git://github.com/chuckha/sonobuoy.git","ssh_url":"git@github.com:chuckha/sonobuoy.git","clone_url":"https://github.com/chuckha/sonobuoy.git","svn_url":"https://github.com/chuckha/sonobuoy","homepage":"http://www.heptio.com","size":7901,"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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"heptio:master","ref":"master","sha":"3539df00ee1dee65c535ca912ee17a93a569acd5","user":{"login":"heptio","id":22035492,"avatar_url":"https://avatars0.githubusercontent.com/u/22035492?v=4","gravatar_id":"","url":"https://api.github.com/users/heptio","html_url":"https://github.com/heptio","followers_url":"https://api.github.com/users/heptio/followers","following_url":"https://api.github.com/users/heptio/following{/other_user}","gists_url":"https://api.github.com/users/heptio/gists{/gist_id}","starred_url":"https://api.github.com/users/heptio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heptio/subscriptions","organizations_url":"https://api.github.com/users/heptio/orgs","repos_url":"https://api.github.com/users/heptio/repos","events_url":"https://api.github.com/users/heptio/events{/privacy}","received_events_url":"https://api.github.com/users/heptio/received_events","type":"Organization","site_admin":false},"repo":{"id":98453563,"name":"sonobuoy","full_name":"heptio/sonobuoy","owner":{"login":"heptio","id":22035492,"avatar_url":"https://avatars0.githubusercontent.com/u/22035492?v=4","gravatar_id":"","url":"https://api.github.com/users/heptio","html_url":"https://github.com/heptio","followers_url":"https://api.github.com/users/heptio/followers","following_url":"https://api.github.com/users/heptio/following{/other_user}","gists_url":"https://api.github.com/users/heptio/gists{/gist_id}","starred_url":"https://api.github.com/users/heptio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heptio/subscriptions","organizations_url":"https://api.github.com/users/heptio/orgs","repos_url":"https://api.github.com/users/heptio/repos","events_url":"https://api.github.com/users/heptio/events{/privacy}","received_events_url":"https://api.github.com/users/heptio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/heptio/sonobuoy","description":"Heptio Sonobuoy is a diagnostic tool that makes it easier to understand the state of a Kubernetes cluster by running a set of Kubernetes conformance tests in an accessible and non-destructive manner. Brought to you by Heptio.","fork":false,"url":"https://api.github.com/repos/heptio/sonobuoy","forks_url":"https://api.github.com/repos/heptio/sonobuoy/forks","keys_url":"https://api.github.com/repos/heptio/sonobuoy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/heptio/sonobuoy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/heptio/sonobuoy/teams","hooks_url":"https://api.github.com/repos/heptio/sonobuoy/hooks","issue_events_url":"https://api.github.com/repos/heptio/sonobuoy/issues/events{/number}","events_url":"https://api.github.com/repos/heptio/sonobuoy/events","assignees_url":"https://api.github.com/repos/heptio/sonobuoy/assignees{/user}","branches_url":"https://api.github.com/repos/heptio/sonobuoy/branches{/branch}","tags_url":"https://api.github.com/repos/heptio/sonobuoy/tags","blobs_url":"https://api.github.com/repos/heptio/sonobuoy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/heptio/sonobuoy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/heptio/sonobuoy/git/refs{/sha}","trees_url":"https://api.github.com/repos/heptio/sonobuoy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/heptio/sonobuoy/statuses/{sha}","languages_url":"https://api.github.com/repos/heptio/sonobuoy/languages","stargazers_url":"https://api.github.com/repos/heptio/sonobuoy/stargazers","contributors_url":"https://api.github.com/repos/heptio/sonobuoy/contributors","subscribers_url":"https://api.github.com/repos/heptio/sonobuoy/subscribers","subscription_url":"https://api.github.com/repos/heptio/sonobuoy/subscription","commits_url":"https://api.github.com/repos/heptio/sonobuoy/commits{/sha}","git_commits_url":"https://api.github.com/repos/heptio/sonobuoy/git/commits{/sha}","comments_url":"https://api.github.com/repos/heptio/sonobuoy/comments{/number}","issue_comment_url":"https://api.github.com/repos/heptio/sonobuoy/issues/comments{/number}","contents_url":"https://api.github.com/repos/heptio/sonobuoy/contents/{+path}","compare_url":"https://api.github.com/repos/heptio/sonobuoy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/heptio/sonobuoy/merges","archive_url":"https://api.github.com/repos/heptio/sonobuoy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/heptio/sonobuoy/downloads","issues_url":"https://api.github.com/repos/heptio/sonobuoy/issues{/number}","pulls_url":"https://api.github.com/repos/heptio/sonobuoy/pulls{/number}","milestones_url":"https://api.github.com/repos/heptio/sonobuoy/milestones{/number}","notifications_url":"https://api.github.com/repos/heptio/sonobuoy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/heptio/sonobuoy/labels{/name}","releases_url":"https://api.github.com/repos/heptio/sonobuoy/releases{/id}","deployments_url":"https://api.github.com/repos/heptio/sonobuoy/deployments","created_at":"2017-07-26T18:27:09Z","updated_at":"2017-12-09T15:16:36Z","pushed_at":"2017-12-06T21:44:58Z","git_url":"git://github.com/heptio/sonobuoy.git","ssh_url":"git@github.com:heptio/sonobuoy.git","clone_url":"https://github.com/heptio/sonobuoy.git","svn_url":"https://github.com/heptio/sonobuoy","homepage":"http://www.heptio.com","size":7811,"stargazers_count":439,"watchers_count":439,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":35,"mirror_url":null,"archived":false,"open_issues_count":22,"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":35,"open_issues":22,"watchers":439,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/heptio/sonobuoy/pulls/164"},"html":{"href":"https://github.com/heptio/sonobuoy/pull/164"},"issue":{"href":"https://api.github.com/repos/heptio/sonobuoy/issues/164"},"comments":{"href":"https://api.github.com/repos/heptio/sonobuoy/issues/164/comments"},"review_comments":{"href":"https://api.github.com/repos/heptio/sonobuoy/pulls/164/comments"},"review_comment":{"href":"https://api.github.com/repos/heptio/sonobuoy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/heptio/sonobuoy/pulls/164/commits"},"statuses":{"href":"https://api.github.com/repos/heptio/sonobuoy/statuses/5f50b4e5b5fc78af3254ed9e076d18af3f7c78ec"}},"author_association":"OWNER"}}
{"actor":{"display_login":"timothysc"}}