{"action":"created","comment":{"url":"https://api.github.com/repos/aws/amazon-ecs-agent/pulls/comments/146082311","pull_request_review_id":70983438,"id":146082311,"diff_hunk":"@@ -163,6 +166,27 @@ func (agent *ecsAgent) printVersion() int {\n \treturn exitcodes.ExitSuccess\n }\n \n+// printECSAttributes prints the Agent's ECS Attributes based on its\n+// environment\n+func (agent *ecsAgent) printECSAttributes() int {\n+\tfor _, attr := range agent.capabilities() {\n+\t\tvar (\n+\t\t\tname  string\n+\t\t\tvalue string\n+\t\t)\n+\n+\t\tif attr.Name != nil {\n+\t\t\tname = *attr.Name\n+\t\t}\n+\t\tif attr.Value != nil {\n+\t\t\tvalue = *attr.Value","path":"agent/app/agent.go","position":27,"original_position":27,"commit_id":"40b5b3d239d582fb3d440f38bf7449e2274ffa79","original_commit_id":"40b5b3d239d582fb3d440f38bf7449e2274ffa79","user":{"login":"aaithal","id":1183359,"avatar_url":"https://avatars1.githubusercontent.com/u/1183359?v=4","gravatar_id":"","url":"https://api.github.com/users/aaithal","html_url":"https://github.com/aaithal","followers_url":"https://api.github.com/users/aaithal/followers","following_url":"https://api.github.com/users/aaithal/following{/other_user}","gists_url":"https://api.github.com/users/aaithal/gists{/gist_id}","starred_url":"https://api.github.com/users/aaithal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaithal/subscriptions","organizations_url":"https://api.github.com/users/aaithal/orgs","repos_url":"https://api.github.com/users/aaithal/repos","events_url":"https://api.github.com/users/aaithal/events{/privacy}","received_events_url":"https://api.github.com/users/aaithal/received_events","type":"User","site_admin":false},"body":"minor: please use `aws.StringValue()` here","created_at":"2017-10-20T22:50:43Z","updated_at":"2017-10-20T22:51:48Z","html_url":"https://github.com/aws/amazon-ecs-agent/pull/1025#discussion_r146082311","pull_request_url":"https://api.github.com/repos/aws/amazon-ecs-agent/pulls/1025","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/aws/amazon-ecs-agent/pulls/comments/146082311"},"html":{"href":"https://github.com/aws/amazon-ecs-agent/pull/1025#discussion_r146082311"},"pull_request":{"href":"https://api.github.com/repos/aws/amazon-ecs-agent/pulls/1025"}}},"pull_request":{"url":"https://api.github.com/repos/aws/amazon-ecs-agent/pulls/1025","id":147868415,"html_url":"https://github.com/aws/amazon-ecs-agent/pull/1025","diff_url":"https://github.com/aws/amazon-ecs-agent/pull/1025.diff","patch_url":"https://github.com/aws/amazon-ecs-agent/pull/1025.patch","issue_url":"https://api.github.com/repos/aws/amazon-ecs-agent/issues/1025","number":1025,"state":"open","locked":false,"title":"Add flag to print capabilities","user":{"login":"jahkeup","id":1139752,"avatar_url":"https://avatars2.githubusercontent.com/u/1139752?v=4","gravatar_id":"","url":"https://api.github.com/users/jahkeup","html_url":"https://github.com/jahkeup","followers_url":"https://api.github.com/users/jahkeup/followers","following_url":"https://api.github.com/users/jahkeup/following{/other_user}","gists_url":"https://api.github.com/users/jahkeup/gists{/gist_id}","starred_url":"https://api.github.com/users/jahkeup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jahkeup/subscriptions","organizations_url":"https://api.github.com/users/jahkeup/orgs","repos_url":"https://api.github.com/users/jahkeup/repos","events_url":"https://api.github.com/users/jahkeup/events{/privacy}","received_events_url":"https://api.github.com/users/jahkeup/received_events","type":"User","site_admin":false},"body":"### Summary\r\nPrint the Agent's capabilities without having to connect it to ECS.\r\n\r\n### Implementation details\r\nThis uses the Agent's existing capability discovery mechanism and prints the values without starting the Agent.\r\n\r\n### Testing\r\nThis was run on an ec2 instance with the added flag.\r\n\r\n- [ ] Builds on Linux (`make release`)\r\n- [ ] Builds on Windows (`go build -out amazon-ecs-agent.exe ./agent`)\r\n- [ ] Unit tests on Linux (`make test`) pass\r\n- [ ] Unit tests on Windows (`go test -timeout=25s ./agent/...`) pass\r\n- [ ] Integration tests on Linux (`make run-integ-tests`) pass\r\n- [ ] Integration tests on Windows (`.\\scripts\\run-integ-tests.ps1`) pass\r\n- [ ] Functional tests on Linux (`make run-functional-tests`) pass\r\n- [ ] Functional tests on Windows (`.\\scripts\\run-functional-tests.ps1`) pass\r\n\r\nNew tests cover the changes: <!-- yes|no -->\r\n\r\n### Description for the changelog\r\nAgent offline capability discovery\r\n\r\n### Licensing\r\nThis contribution is under the terms of the Apache 2.0 License: yes\r\n","created_at":"2017-10-20T18:42:14Z","updated_at":"2017-10-20T22:51:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b2678128633cc0a8f0085ccf95a2378963aa6cb2","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/aws/amazon-ecs-agent/pulls/1025/commits","review_comments_url":"https://api.github.com/repos/aws/amazon-ecs-agent/pulls/1025/comments","review_comment_url":"https://api.github.com/repos/aws/amazon-ecs-agent/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aws/amazon-ecs-agent/issues/1025/comments","statuses_url":"https://api.github.com/repos/aws/amazon-ecs-agent/statuses/40b5b3d239d582fb3d440f38bf7449e2274ffa79","head":{"label":"jahkeup:capabilities-flag","ref":"capabilities-flag","sha":"40b5b3d239d582fb3d440f38bf7449e2274ffa79","user":{"login":"jahkeup","id":1139752,"avatar_url":"https://avatars2.githubusercontent.com/u/1139752?v=4","gravatar_id":"","url":"https://api.github.com/users/jahkeup","html_url":"https://github.com/jahkeup","followers_url":"https://api.github.com/users/jahkeup/followers","following_url":"https://api.github.com/users/jahkeup/following{/other_user}","gists_url":"https://api.github.com/users/jahkeup/gists{/gist_id}","starred_url":"https://api.github.com/users/jahkeup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jahkeup/subscriptions","organizations_url":"https://api.github.com/users/jahkeup/orgs","repos_url":"https://api.github.com/users/jahkeup/repos","events_url":"https://api.github.com/users/jahkeup/events{/privacy}","received_events_url":"https://api.github.com/users/jahkeup/received_events","type":"User","site_admin":false},"repo":{"id":84351043,"name":"amazon-ecs-agent","full_name":"jahkeup/amazon-ecs-agent","owner":{"login":"jahkeup","id":1139752,"avatar_url":"https://avatars2.githubusercontent.com/u/1139752?v=4","gravatar_id":"","url":"https://api.github.com/users/jahkeup","html_url":"https://github.com/jahkeup","followers_url":"https://api.github.com/users/jahkeup/followers","following_url":"https://api.github.com/users/jahkeup/following{/other_user}","gists_url":"https://api.github.com/users/jahkeup/gists{/gist_id}","starred_url":"https://api.github.com/users/jahkeup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jahkeup/subscriptions","organizations_url":"https://api.github.com/users/jahkeup/orgs","repos_url":"https://api.github.com/users/jahkeup/repos","events_url":"https://api.github.com/users/jahkeup/events{/privacy}","received_events_url":"https://api.github.com/users/jahkeup/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jahkeup/amazon-ecs-agent","description":"Amazon EC2 Container Service Agent","fork":true,"url":"https://api.github.com/repos/jahkeup/amazon-ecs-agent","forks_url":"https://api.github.com/repos/jahkeup/amazon-ecs-agent/forks","keys_url":"https://api.github.com/repos/jahkeup/amazon-ecs-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jahkeup/amazon-ecs-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jahkeup/amazon-ecs-agent/teams","hooks_url":"https://api.github.com/repos/jahkeup/amazon-ecs-agent/hooks","issue_events_url":"https://api.github.com/repos/jahkeup/amazon-ecs-agent/issues/events{/number}","events_url":"https://api.github.com/repos/jahkeup/amazon-ecs-agent/events","assignees_url":"https://api.github.com/repos/jahkeup/amazon-ecs-agent/assignees{/user}","branches_url":"https://api.github.com/repos/jahkeup/amazon-ecs-agent/branches{/branch}","tags_url":"https://api.github.com/repos/jahkeup/amazon-ecs-agent/tags","blobs_url":"https://api.github.com/repos/jahkeup/amazon-ecs-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jahkeup/amazon-ecs-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jahkeup/amazon-ecs-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/jahkeup/amazon-ecs-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jahkeup/amazon-ecs-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/jahkeup/amazon-ecs-agent/languages","stargazers_url":"https://api.github.com/repos/jahkeup/amazon-ecs-agent/stargazers","contributors_url":"https://api.github.com/repos/jahkeup/amazon-ecs-agent/contributors","subscribers_url":"https://api.github.com/repos/jahkeup/amazon-ecs-agent/subscribers","subscription_url":"https://api.github.com/repos/jahkeup/amazon-ecs-agent/subscription","commits_url":"https://api.github.com/repos/jahkeup/amazon-ecs-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/jahkeup/amazon-ecs-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/jahkeup/amazon-ecs-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/jahkeup/amazon-ecs-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/jahkeup/amazon-ecs-agent/contents/{+path}","compare_url":"https://api.github.com/repos/jahkeup/amazon-ecs-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jahkeup/amazon-ecs-agent/merges","archive_url":"https://api.github.com/repos/jahkeup/amazon-ecs-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jahkeup/amazon-ecs-agent/downloads","issues_url":"https://api.github.com/repos/jahkeup/amazon-ecs-agent/issues{/number}","pulls_url":"https://api.github.com/repos/jahkeup/amazon-ecs-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/jahkeup/amazon-ecs-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/jahkeup/amazon-ecs-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jahkeup/amazon-ecs-agent/labels{/name}","releases_url":"https://api.github.com/repos/jahkeup/amazon-ecs-agent/releases{/id}","deployments_url":"https://api.github.com/repos/jahkeup/amazon-ecs-agent/deployments","created_at":"2017-03-08T18:03:24Z","updated_at":"2017-03-08T18:03:27Z","pushed_at":"2017-10-20T22:24:14Z","git_url":"git://github.com/jahkeup/amazon-ecs-agent.git","ssh_url":"git@github.com:jahkeup/amazon-ecs-agent.git","clone_url":"https://github.com/jahkeup/amazon-ecs-agent.git","svn_url":"https://github.com/jahkeup/amazon-ecs-agent","homepage":"http://aws.amazon.com/ecs/","size":6818,"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,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"aws:dev","ref":"dev","sha":"d020b55b1d7bc859fd3dd01a08103776ac596e25","user":{"login":"aws","id":2232217,"avatar_url":"https://avatars3.githubusercontent.com/u/2232217?v=4","gravatar_id":"","url":"https://api.github.com/users/aws","html_url":"https://github.com/aws","followers_url":"https://api.github.com/users/aws/followers","following_url":"https://api.github.com/users/aws/following{/other_user}","gists_url":"https://api.github.com/users/aws/gists{/gist_id}","starred_url":"https://api.github.com/users/aws/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aws/subscriptions","organizations_url":"https://api.github.com/users/aws/orgs","repos_url":"https://api.github.com/users/aws/repos","events_url":"https://api.github.com/users/aws/events{/privacy}","received_events_url":"https://api.github.com/users/aws/received_events","type":"Organization","site_admin":false},"repo":{"id":27551774,"name":"amazon-ecs-agent","full_name":"aws/amazon-ecs-agent","owner":{"login":"aws","id":2232217,"avatar_url":"https://avatars3.githubusercontent.com/u/2232217?v=4","gravatar_id":"","url":"https://api.github.com/users/aws","html_url":"https://github.com/aws","followers_url":"https://api.github.com/users/aws/followers","following_url":"https://api.github.com/users/aws/following{/other_user}","gists_url":"https://api.github.com/users/aws/gists{/gist_id}","starred_url":"https://api.github.com/users/aws/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aws/subscriptions","organizations_url":"https://api.github.com/users/aws/orgs","repos_url":"https://api.github.com/users/aws/repos","events_url":"https://api.github.com/users/aws/events{/privacy}","received_events_url":"https://api.github.com/users/aws/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aws/amazon-ecs-agent","description":"Amazon EC2 Container Service Agent","fork":false,"url":"https://api.github.com/repos/aws/amazon-ecs-agent","forks_url":"https://api.github.com/repos/aws/amazon-ecs-agent/forks","keys_url":"https://api.github.com/repos/aws/amazon-ecs-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aws/amazon-ecs-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aws/amazon-ecs-agent/teams","hooks_url":"https://api.github.com/repos/aws/amazon-ecs-agent/hooks","issue_events_url":"https://api.github.com/repos/aws/amazon-ecs-agent/issues/events{/number}","events_url":"https://api.github.com/repos/aws/amazon-ecs-agent/events","assignees_url":"https://api.github.com/repos/aws/amazon-ecs-agent/assignees{/user}","branches_url":"https://api.github.com/repos/aws/amazon-ecs-agent/branches{/branch}","tags_url":"https://api.github.com/repos/aws/amazon-ecs-agent/tags","blobs_url":"https://api.github.com/repos/aws/amazon-ecs-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aws/amazon-ecs-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aws/amazon-ecs-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/aws/amazon-ecs-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aws/amazon-ecs-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/aws/amazon-ecs-agent/languages","stargazers_url":"https://api.github.com/repos/aws/amazon-ecs-agent/stargazers","contributors_url":"https://api.github.com/repos/aws/amazon-ecs-agent/contributors","subscribers_url":"https://api.github.com/repos/aws/amazon-ecs-agent/subscribers","subscription_url":"https://api.github.com/repos/aws/amazon-ecs-agent/subscription","commits_url":"https://api.github.com/repos/aws/amazon-ecs-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/aws/amazon-ecs-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/aws/amazon-ecs-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/aws/amazon-ecs-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/aws/amazon-ecs-agent/contents/{+path}","compare_url":"https://api.github.com/repos/aws/amazon-ecs-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aws/amazon-ecs-agent/merges","archive_url":"https://api.github.com/repos/aws/amazon-ecs-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aws/amazon-ecs-agent/downloads","issues_url":"https://api.github.com/repos/aws/amazon-ecs-agent/issues{/number}","pulls_url":"https://api.github.com/repos/aws/amazon-ecs-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/aws/amazon-ecs-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/aws/amazon-ecs-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aws/amazon-ecs-agent/labels{/name}","releases_url":"https://api.github.com/repos/aws/amazon-ecs-agent/releases{/id}","deployments_url":"https://api.github.com/repos/aws/amazon-ecs-agent/deployments","created_at":"2014-12-04T17:31:49Z","updated_at":"2017-10-19T06:30:10Z","pushed_at":"2017-10-20T22:35:19Z","git_url":"git://github.com/aws/amazon-ecs-agent.git","ssh_url":"git@github.com:aws/amazon-ecs-agent.git","clone_url":"https://github.com/aws/amazon-ecs-agent.git","svn_url":"https://github.com/aws/amazon-ecs-agent","homepage":"http://aws.amazon.com/ecs/","size":7046,"stargazers_count":1019,"watchers_count":1019,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":268,"mirror_url":null,"archived":false,"open_issues_count":138,"forks":268,"open_issues":138,"watchers":1019,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aws/amazon-ecs-agent/pulls/1025"},"html":{"href":"https://github.com/aws/amazon-ecs-agent/pull/1025"},"issue":{"href":"https://api.github.com/repos/aws/amazon-ecs-agent/issues/1025"},"comments":{"href":"https://api.github.com/repos/aws/amazon-ecs-agent/issues/1025/comments"},"review_comments":{"href":"https://api.github.com/repos/aws/amazon-ecs-agent/pulls/1025/comments"},"review_comment":{"href":"https://api.github.com/repos/aws/amazon-ecs-agent/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aws/amazon-ecs-agent/pulls/1025/commits"},"statuses":{"href":"https://api.github.com/repos/aws/amazon-ecs-agent/statuses/40b5b3d239d582fb3d440f38bf7449e2274ffa79"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"aaithal"}}