{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/pulls/comments/89841997","pull_request_review_id":10369764,"id":89841997,"diff_hunk":"@@ -102,3 +103,47 @@ func (s pstateSource) Discover() ([]string, error) {\n \n \treturn features, nil\n }\n+\n+////////////////////////////////////////////////////////////////////////////////\n+// Network Source\n+\n+// Implements main.FeatureSource.\n+type networkSource struct{}\n+\n+func (s networkSource) Name() string { return \"netid\" }\n+func (s networkSource) Discover() ([]string, error) {\n+\tfeatures := []string{}\n+\tvar total_num_vfs int = 0\n+\t// sysfs of the node mounted as /hostsys inside the pod\n+\tnetInterfaces, err := ioutil.ReadDir(\"/hostsys/class/net\") //does not return . and ..\n+\tif err != nil {\n+\t\treturn nil, fmt.Errorf(\"can't obtain the network interfaces: %s\", err.Error())\n+\t}\n+\tfor _, netInterface := range netInterfaces {\n+\t\t//forming the file name : /hostsys/class/net/<network interface>/device/sriov_numvfs\n+\t\tfilename := \"/hostsys/class/net/\" + netInterface.Name() + \"/device/sriov_numvfs\"\n+\t\tbytes_received, err := ioutil.ReadFile(filename)\n+\t\tif err != nil {\n+\t\t\t// interface does not support SRIOV\n+\t\t\tcontinue // proceeding to next iteration for next network interface\n+\t\t}\n+\t\t//removing white spaces","path":"sources.go","position":44,"original_position":44,"commit_id":"80fcc8904bee1c301517857d4151de8cfad3d416","original_commit_id":"80fcc8904bee1c301517857d4151de8cfad3d416","user":{"login":"balajismaniam","id":4707353,"avatar_url":"https://avatars.githubusercontent.com/u/4707353?v=3","gravatar_id":"","url":"https://api.github.com/users/balajismaniam","html_url":"https://github.com/balajismaniam","followers_url":"https://api.github.com/users/balajismaniam/followers","following_url":"https://api.github.com/users/balajismaniam/following{/other_user}","gists_url":"https://api.github.com/users/balajismaniam/gists{/gist_id}","starred_url":"https://api.github.com/users/balajismaniam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balajismaniam/subscriptions","organizations_url":"https://api.github.com/users/balajismaniam/orgs","repos_url":"https://api.github.com/users/balajismaniam/repos","events_url":"https://api.github.com/users/balajismaniam/events{/privacy}","received_events_url":"https://api.github.com/users/balajismaniam/received_events","type":"User","site_admin":false},"body":"Delete this comment.","created_at":"2016-11-28T18:05:04Z","updated_at":"2016-11-28T18:05:04Z","html_url":"https://github.com/kubernetes-incubator/node-feature-discovery/pull/49#discussion_r89841997","pull_request_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/pulls/49","_links":{"self":{"href":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/pulls/comments/89841997"},"html":{"href":"https://github.com/kubernetes-incubator/node-feature-discovery/pull/49#discussion_r89841997"},"pull_request":{"href":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/pulls/49"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/pulls/49","id":95332464,"html_url":"https://github.com/kubernetes-incubator/node-feature-discovery/pull/49","diff_url":"https://github.com/kubernetes-incubator/node-feature-discovery/pull/49.diff","patch_url":"https://github.com/kubernetes-incubator/node-feature-discovery/pull/49.patch","issue_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/issues/49","number":49,"state":"open","locked":false,"title":"Adding SR-IOV capability discovery to node-feature-discovery","user":{"login":"swatisehgal","id":18619641,"avatar_url":"https://avatars.githubusercontent.com/u/18619641?v=3","gravatar_id":"","url":"https://api.github.com/users/swatisehgal","html_url":"https://github.com/swatisehgal","followers_url":"https://api.github.com/users/swatisehgal/followers","following_url":"https://api.github.com/users/swatisehgal/following{/other_user}","gists_url":"https://api.github.com/users/swatisehgal/gists{/gist_id}","starred_url":"https://api.github.com/users/swatisehgal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swatisehgal/subscriptions","organizations_url":"https://api.github.com/users/swatisehgal/orgs","repos_url":"https://api.github.com/users/swatisehgal/repos","events_url":"https://api.github.com/users/swatisehgal/events{/privacy}","received_events_url":"https://api.github.com/users/swatisehgal/received_events","type":"User","site_admin":false},"body":"PR in reference to https://github.com/kubernetes-incubator/node-feature-discovery/issues/35","created_at":"2016-11-25T17:10:07Z","updated_at":"2016-11-28T18:41:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"55020b37477828ecee57af69b8f41bcc5646f0bc","assignee":{"login":"balajismaniam","id":4707353,"avatar_url":"https://avatars.githubusercontent.com/u/4707353?v=3","gravatar_id":"","url":"https://api.github.com/users/balajismaniam","html_url":"https://github.com/balajismaniam","followers_url":"https://api.github.com/users/balajismaniam/followers","following_url":"https://api.github.com/users/balajismaniam/following{/other_user}","gists_url":"https://api.github.com/users/balajismaniam/gists{/gist_id}","starred_url":"https://api.github.com/users/balajismaniam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balajismaniam/subscriptions","organizations_url":"https://api.github.com/users/balajismaniam/orgs","repos_url":"https://api.github.com/users/balajismaniam/repos","events_url":"https://api.github.com/users/balajismaniam/events{/privacy}","received_events_url":"https://api.github.com/users/balajismaniam/received_events","type":"User","site_admin":false},"assignees":[{"login":"balajismaniam","id":4707353,"avatar_url":"https://avatars.githubusercontent.com/u/4707353?v=3","gravatar_id":"","url":"https://api.github.com/users/balajismaniam","html_url":"https://github.com/balajismaniam","followers_url":"https://api.github.com/users/balajismaniam/followers","following_url":"https://api.github.com/users/balajismaniam/following{/other_user}","gists_url":"https://api.github.com/users/balajismaniam/gists{/gist_id}","starred_url":"https://api.github.com/users/balajismaniam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balajismaniam/subscriptions","organizations_url":"https://api.github.com/users/balajismaniam/orgs","repos_url":"https://api.github.com/users/balajismaniam/repos","events_url":"https://api.github.com/users/balajismaniam/events{/privacy}","received_events_url":"https://api.github.com/users/balajismaniam/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/pulls/49/commits","review_comments_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/pulls/49/comments","review_comment_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/issues/49/comments","statuses_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/statuses/80fcc8904bee1c301517857d4151de8cfad3d416","head":{"label":"swatisehgal:master","ref":"master","sha":"80fcc8904bee1c301517857d4151de8cfad3d416","user":{"login":"swatisehgal","id":18619641,"avatar_url":"https://avatars.githubusercontent.com/u/18619641?v=3","gravatar_id":"","url":"https://api.github.com/users/swatisehgal","html_url":"https://github.com/swatisehgal","followers_url":"https://api.github.com/users/swatisehgal/followers","following_url":"https://api.github.com/users/swatisehgal/following{/other_user}","gists_url":"https://api.github.com/users/swatisehgal/gists{/gist_id}","starred_url":"https://api.github.com/users/swatisehgal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swatisehgal/subscriptions","organizations_url":"https://api.github.com/users/swatisehgal/orgs","repos_url":"https://api.github.com/users/swatisehgal/repos","events_url":"https://api.github.com/users/swatisehgal/events{/privacy}","received_events_url":"https://api.github.com/users/swatisehgal/received_events","type":"User","site_admin":false},"repo":{"id":74774044,"name":"node-feature-discovery","full_name":"swatisehgal/node-feature-discovery","owner":{"login":"swatisehgal","id":18619641,"avatar_url":"https://avatars.githubusercontent.com/u/18619641?v=3","gravatar_id":"","url":"https://api.github.com/users/swatisehgal","html_url":"https://github.com/swatisehgal","followers_url":"https://api.github.com/users/swatisehgal/followers","following_url":"https://api.github.com/users/swatisehgal/following{/other_user}","gists_url":"https://api.github.com/users/swatisehgal/gists{/gist_id}","starred_url":"https://api.github.com/users/swatisehgal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swatisehgal/subscriptions","organizations_url":"https://api.github.com/users/swatisehgal/orgs","repos_url":"https://api.github.com/users/swatisehgal/repos","events_url":"https://api.github.com/users/swatisehgal/events{/privacy}","received_events_url":"https://api.github.com/users/swatisehgal/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/swatisehgal/node-feature-discovery","description":"Node feature discovery for Kubernetes","fork":true,"url":"https://api.github.com/repos/swatisehgal/node-feature-discovery","forks_url":"https://api.github.com/repos/swatisehgal/node-feature-discovery/forks","keys_url":"https://api.github.com/repos/swatisehgal/node-feature-discovery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/swatisehgal/node-feature-discovery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/swatisehgal/node-feature-discovery/teams","hooks_url":"https://api.github.com/repos/swatisehgal/node-feature-discovery/hooks","issue_events_url":"https://api.github.com/repos/swatisehgal/node-feature-discovery/issues/events{/number}","events_url":"https://api.github.com/repos/swatisehgal/node-feature-discovery/events","assignees_url":"https://api.github.com/repos/swatisehgal/node-feature-discovery/assignees{/user}","branches_url":"https://api.github.com/repos/swatisehgal/node-feature-discovery/branches{/branch}","tags_url":"https://api.github.com/repos/swatisehgal/node-feature-discovery/tags","blobs_url":"https://api.github.com/repos/swatisehgal/node-feature-discovery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/swatisehgal/node-feature-discovery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/swatisehgal/node-feature-discovery/git/refs{/sha}","trees_url":"https://api.github.com/repos/swatisehgal/node-feature-discovery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/swatisehgal/node-feature-discovery/statuses/{sha}","languages_url":"https://api.github.com/repos/swatisehgal/node-feature-discovery/languages","stargazers_url":"https://api.github.com/repos/swatisehgal/node-feature-discovery/stargazers","contributors_url":"https://api.github.com/repos/swatisehgal/node-feature-discovery/contributors","subscribers_url":"https://api.github.com/repos/swatisehgal/node-feature-discovery/subscribers","subscription_url":"https://api.github.com/repos/swatisehgal/node-feature-discovery/subscription","commits_url":"https://api.github.com/repos/swatisehgal/node-feature-discovery/commits{/sha}","git_commits_url":"https://api.github.com/repos/swatisehgal/node-feature-discovery/git/commits{/sha}","comments_url":"https://api.github.com/repos/swatisehgal/node-feature-discovery/comments{/number}","issue_comment_url":"https://api.github.com/repos/swatisehgal/node-feature-discovery/issues/comments{/number}","contents_url":"https://api.github.com/repos/swatisehgal/node-feature-discovery/contents/{+path}","compare_url":"https://api.github.com/repos/swatisehgal/node-feature-discovery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/swatisehgal/node-feature-discovery/merges","archive_url":"https://api.github.com/repos/swatisehgal/node-feature-discovery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/swatisehgal/node-feature-discovery/downloads","issues_url":"https://api.github.com/repos/swatisehgal/node-feature-discovery/issues{/number}","pulls_url":"https://api.github.com/repos/swatisehgal/node-feature-discovery/pulls{/number}","milestones_url":"https://api.github.com/repos/swatisehgal/node-feature-discovery/milestones{/number}","notifications_url":"https://api.github.com/repos/swatisehgal/node-feature-discovery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/swatisehgal/node-feature-discovery/labels{/name}","releases_url":"https://api.github.com/repos/swatisehgal/node-feature-discovery/releases{/id}","deployments_url":"https://api.github.com/repos/swatisehgal/node-feature-discovery/deployments","created_at":"2016-11-25T16:38:08Z","updated_at":"2016-11-25T16:38:09Z","pushed_at":"2016-11-25T16:46:59Z","git_url":"git://github.com/swatisehgal/node-feature-discovery.git","ssh_url":"git@github.com:swatisehgal/node-feature-discovery.git","clone_url":"https://github.com/swatisehgal/node-feature-discovery.git","svn_url":"https://github.com/swatisehgal/node-feature-discovery","homepage":"","size":74367,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kubernetes-incubator:master","ref":"master","sha":"e98eb99ad32e318cfe1c89f34ffaa7e966d32b2d","user":{"login":"kubernetes-incubator","id":20862812,"avatar_url":"https://avatars.githubusercontent.com/u/20862812?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes-incubator","html_url":"https://github.com/kubernetes-incubator","followers_url":"https://api.github.com/users/kubernetes-incubator/followers","following_url":"https://api.github.com/users/kubernetes-incubator/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes-incubator/subscriptions","organizations_url":"https://api.github.com/users/kubernetes-incubator/orgs","repos_url":"https://api.github.com/users/kubernetes-incubator/repos","events_url":"https://api.github.com/users/kubernetes-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes-incubator/received_events","type":"Organization","site_admin":false},"repo":{"id":63999998,"name":"node-feature-discovery","full_name":"kubernetes-incubator/node-feature-discovery","owner":{"login":"kubernetes-incubator","id":20862812,"avatar_url":"https://avatars.githubusercontent.com/u/20862812?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes-incubator","html_url":"https://github.com/kubernetes-incubator","followers_url":"https://api.github.com/users/kubernetes-incubator/followers","following_url":"https://api.github.com/users/kubernetes-incubator/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes-incubator/subscriptions","organizations_url":"https://api.github.com/users/kubernetes-incubator/orgs","repos_url":"https://api.github.com/users/kubernetes-incubator/repos","events_url":"https://api.github.com/users/kubernetes-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes-incubator/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubernetes-incubator/node-feature-discovery","description":"Node feature discovery for Kubernetes","fork":false,"url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery","forks_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/forks","keys_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/teams","hooks_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/hooks","issue_events_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/events","assignees_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/tags","blobs_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/languages","stargazers_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/stargazers","contributors_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/contributors","subscribers_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/subscribers","subscription_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/subscription","commits_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/merges","archive_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/downloads","issues_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/releases{/id}","deployments_url":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/deployments","created_at":"2016-07-23T05:07:52Z","updated_at":"2016-11-20T23:38:01Z","pushed_at":"2016-11-25T17:10:09Z","git_url":"git://github.com/kubernetes-incubator/node-feature-discovery.git","ssh_url":"git@github.com:kubernetes-incubator/node-feature-discovery.git","clone_url":"https://github.com/kubernetes-incubator/node-feature-discovery.git","svn_url":"https://github.com/kubernetes-incubator/node-feature-discovery","homepage":"","size":74364,"stargazers_count":28,"watchers_count":28,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":10,"forks":10,"open_issues":10,"watchers":28,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/pulls/49"},"html":{"href":"https://github.com/kubernetes-incubator/node-feature-discovery/pull/49"},"issue":{"href":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/issues/49"},"comments":{"href":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/issues/49/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/pulls/49/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/pulls/49/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes-incubator/node-feature-discovery/statuses/80fcc8904bee1c301517857d4151de8cfad3d416"}}}}
{"actor":{"display_login":"balajismaniam"}}