{"action":"created","comment":{"url":"https://api.github.com/repos/kinvolk/kube-spawn/pulls/comments/211928968","pull_request_review_id":148450587,"id":211928968,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMTkyODk2OA==","diff_hunk":"@@ -93,13 +93,59 @@ func GetPoolSize(baseImageName string, nodes int) (int64, error) {\n \treturn poolSize, nil\n }\n \n+func setPoolLimit(poolSize int64) error {\n+\tvar cmdPath string\n+\tvar err error\n+\n+\tif cmdPath, err = exec.LookPath(\"machinectl\"); err != nil {\n+\t\treturn fmt.Errorf(\"machinectl not installed: %s\", err)\n+\t}\n+\n+\targs := []string{\n+\t\tcmdPath,\n+\t\t\"set-limit\",\n+\t\tstrconv.FormatInt(poolSize, 10),\n+\t}\n+\n+\tcmd := exec.Cmd{\n+\t\tPath:   cmdPath,\n+\t\tArgs:   args,\n+\t\tEnv:    os.Environ(),\n+\t\tStdout: os.Stdout,\n+\t\tStderr: os.Stderr,\n+\t}\n+\n+\tif err := cmd.Run(); err != nil {\n+\t\t// We do expect this might occur. E.g. if they have\n+\t\t// already started using the pool\n+\t\treturn fmt.Errorf(\"error running machinectl: %s\", err)\n+\t}\n+\n+\treturn nil\n+}\n+\n func EnlargeStoragePool(poolSize int64) error {\n-\t// It is equivalent to the following shell commands:\n+\t// Check to see if the filesystem is already >= poolSize\n+\tvar stat syscall.Statfs_t\n+\tif err := syscall.Statfs(machinesDir, &stat); err == nil {\n+\t\tif stat.Bsize >= poolSize {\n+\t\t\treturn nil\n+\t\t}\n+\t}\n+\n+\t// First call `machinectl set-limit size`. If this succeeds,\n+\t// we are done\n+\tif err := setPoolLimit(poolSize); err == nil {\n+\t\treturn nil","path":"pkg/bootstrap/node.go","position":48,"original_position":48,"commit_id":"bad929a9fbb2acb1e5f8faf7241bb031e13be2ed","original_commit_id":"79af79db39c5fac4feebec4233b474d3a9984d8a","user":{"login":"donbowman","id":5131923,"node_id":"MDQ6VXNlcjUxMzE5MjM=","avatar_url":"https://avatars0.githubusercontent.com/u/5131923?v=4","gravatar_id":"","url":"https://api.github.com/users/donbowman","html_url":"https://github.com/donbowman","followers_url":"https://api.github.com/users/donbowman/followers","following_url":"https://api.github.com/users/donbowman/following{/other_user}","gists_url":"https://api.github.com/users/donbowman/gists{/gist_id}","starred_url":"https://api.github.com/users/donbowman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donbowman/subscriptions","organizations_url":"https://api.github.com/users/donbowman/orgs","repos_url":"https://api.github.com/users/donbowman/repos","events_url":"https://api.github.com/users/donbowman/events{/privacy}","received_events_url":"https://api.github.com/users/donbowman/received_events","type":"User","site_admin":false},"body":"in this case its not checking for error, its checking for success. E.g. if setPoolLimit() succeeds, we are done. Only if it fails do we need to try the backup 'unmount/resize/remount'.\r\n\r\ne.g. i would not want to return err @ this time.\r\n","created_at":"2018-08-22T12:06:33Z","updated_at":"2018-08-22T12:06:33Z","html_url":"https://github.com/kinvolk/kube-spawn/pull/300#discussion_r211928968","pull_request_url":"https://api.github.com/repos/kinvolk/kube-spawn/pulls/300","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/kinvolk/kube-spawn/pulls/comments/211928968"},"html":{"href":"https://github.com/kinvolk/kube-spawn/pull/300#discussion_r211928968"},"pull_request":{"href":"https://api.github.com/repos/kinvolk/kube-spawn/pulls/300"}},"in_reply_to_id":211869591},"pull_request":{"url":"https://api.github.com/repos/kinvolk/kube-spawn/pulls/300","id":208885239,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA4ODg1MjM5","html_url":"https://github.com/kinvolk/kube-spawn/pull/300","diff_url":"https://github.com/kinvolk/kube-spawn/pull/300.diff","patch_url":"https://github.com/kinvolk/kube-spawn/pull/300.patch","issue_url":"https://api.github.com/repos/kinvolk/kube-spawn/issues/300","number":300,"state":"open","locked":false,"title":"Correct resize /var/lib/machines logic","user":{"login":"donbowman","id":5131923,"node_id":"MDQ6VXNlcjUxMzE5MjM=","avatar_url":"https://avatars0.githubusercontent.com/u/5131923?v=4","gravatar_id":"","url":"https://api.github.com/users/donbowman","html_url":"https://github.com/donbowman","followers_url":"https://api.github.com/users/donbowman/followers","following_url":"https://api.github.com/users/donbowman/following{/other_user}","gists_url":"https://api.github.com/users/donbowman/gists{/gist_id}","starred_url":"https://api.github.com/users/donbowman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donbowman/subscriptions","organizations_url":"https://api.github.com/users/donbowman/orgs","repos_url":"https://api.github.com/users/donbowman/repos","events_url":"https://api.github.com/users/donbowman/events{/privacy}","received_events_url":"https://api.github.com/users/donbowman/received_events","type":"User","site_admin":false},"body":"This regression broke my ability to run (since /var/lib/machines is mounted on a real partition, not loopback).\r\n\r\nCommit message has the bulk of the rationale.\r\n\r\nAlso correct missing error handling.","created_at":"2018-08-16T14:48:02Z","updated_at":"2018-08-22T12:06:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fa09a7b25a7c4ee314199815b1f52d1102dd8540","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/kinvolk/kube-spawn/pulls/300/commits","review_comments_url":"https://api.github.com/repos/kinvolk/kube-spawn/pulls/300/comments","review_comment_url":"https://api.github.com/repos/kinvolk/kube-spawn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kinvolk/kube-spawn/issues/300/comments","statuses_url":"https://api.github.com/repos/kinvolk/kube-spawn/statuses/bad929a9fbb2acb1e5f8faf7241bb031e13be2ed","head":{"label":"donbowman:resize-machines","ref":"resize-machines","sha":"bad929a9fbb2acb1e5f8faf7241bb031e13be2ed","user":{"login":"donbowman","id":5131923,"node_id":"MDQ6VXNlcjUxMzE5MjM=","avatar_url":"https://avatars0.githubusercontent.com/u/5131923?v=4","gravatar_id":"","url":"https://api.github.com/users/donbowman","html_url":"https://github.com/donbowman","followers_url":"https://api.github.com/users/donbowman/followers","following_url":"https://api.github.com/users/donbowman/following{/other_user}","gists_url":"https://api.github.com/users/donbowman/gists{/gist_id}","starred_url":"https://api.github.com/users/donbowman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donbowman/subscriptions","organizations_url":"https://api.github.com/users/donbowman/orgs","repos_url":"https://api.github.com/users/donbowman/repos","events_url":"https://api.github.com/users/donbowman/events{/privacy}","received_events_url":"https://api.github.com/users/donbowman/received_events","type":"User","site_admin":false},"repo":{"id":141443044,"node_id":"MDEwOlJlcG9zaXRvcnkxNDE0NDMwNDQ=","name":"kube-spawn","full_name":"donbowman/kube-spawn","owner":{"login":"donbowman","id":5131923,"node_id":"MDQ6VXNlcjUxMzE5MjM=","avatar_url":"https://avatars0.githubusercontent.com/u/5131923?v=4","gravatar_id":"","url":"https://api.github.com/users/donbowman","html_url":"https://github.com/donbowman","followers_url":"https://api.github.com/users/donbowman/followers","following_url":"https://api.github.com/users/donbowman/following{/other_user}","gists_url":"https://api.github.com/users/donbowman/gists{/gist_id}","starred_url":"https://api.github.com/users/donbowman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donbowman/subscriptions","organizations_url":"https://api.github.com/users/donbowman/orgs","repos_url":"https://api.github.com/users/donbowman/repos","events_url":"https://api.github.com/users/donbowman/events{/privacy}","received_events_url":"https://api.github.com/users/donbowman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/donbowman/kube-spawn","description":"A tool for creating multi-node Kubernetes clusters on a Linux machine using kubeadm & systemd-nspawn. Brought to you by the Kinvolk team.","fork":true,"url":"https://api.github.com/repos/donbowman/kube-spawn","forks_url":"https://api.github.com/repos/donbowman/kube-spawn/forks","keys_url":"https://api.github.com/repos/donbowman/kube-spawn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/donbowman/kube-spawn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/donbowman/kube-spawn/teams","hooks_url":"https://api.github.com/repos/donbowman/kube-spawn/hooks","issue_events_url":"https://api.github.com/repos/donbowman/kube-spawn/issues/events{/number}","events_url":"https://api.github.com/repos/donbowman/kube-spawn/events","assignees_url":"https://api.github.com/repos/donbowman/kube-spawn/assignees{/user}","branches_url":"https://api.github.com/repos/donbowman/kube-spawn/branches{/branch}","tags_url":"https://api.github.com/repos/donbowman/kube-spawn/tags","blobs_url":"https://api.github.com/repos/donbowman/kube-spawn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/donbowman/kube-spawn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/donbowman/kube-spawn/git/refs{/sha}","trees_url":"https://api.github.com/repos/donbowman/kube-spawn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/donbowman/kube-spawn/statuses/{sha}","languages_url":"https://api.github.com/repos/donbowman/kube-spawn/languages","stargazers_url":"https://api.github.com/repos/donbowman/kube-spawn/stargazers","contributors_url":"https://api.github.com/repos/donbowman/kube-spawn/contributors","subscribers_url":"https://api.github.com/repos/donbowman/kube-spawn/subscribers","subscription_url":"https://api.github.com/repos/donbowman/kube-spawn/subscription","commits_url":"https://api.github.com/repos/donbowman/kube-spawn/commits{/sha}","git_commits_url":"https://api.github.com/repos/donbowman/kube-spawn/git/commits{/sha}","comments_url":"https://api.github.com/repos/donbowman/kube-spawn/comments{/number}","issue_comment_url":"https://api.github.com/repos/donbowman/kube-spawn/issues/comments{/number}","contents_url":"https://api.github.com/repos/donbowman/kube-spawn/contents/{+path}","compare_url":"https://api.github.com/repos/donbowman/kube-spawn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/donbowman/kube-spawn/merges","archive_url":"https://api.github.com/repos/donbowman/kube-spawn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/donbowman/kube-spawn/downloads","issues_url":"https://api.github.com/repos/donbowman/kube-spawn/issues{/number}","pulls_url":"https://api.github.com/repos/donbowman/kube-spawn/pulls{/number}","milestones_url":"https://api.github.com/repos/donbowman/kube-spawn/milestones{/number}","notifications_url":"https://api.github.com/repos/donbowman/kube-spawn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/donbowman/kube-spawn/labels{/name}","releases_url":"https://api.github.com/repos/donbowman/kube-spawn/releases{/id}","deployments_url":"https://api.github.com/repos/donbowman/kube-spawn/deployments","created_at":"2018-07-18T14:04:42Z","updated_at":"2018-07-28T16:18:46Z","pushed_at":"2018-08-22T12:05:38Z","git_url":"git://github.com/donbowman/kube-spawn.git","ssh_url":"git@github.com:donbowman/kube-spawn.git","clone_url":"https://github.com/donbowman/kube-spawn.git","svn_url":"https://github.com/donbowman/kube-spawn","homepage":"https://kinvolk.io","size":13917,"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","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kinvolk:master","ref":"master","sha":"ea35ea587ca74ec6ff1d5ada2a5b279cf28b8816","user":{"login":"kinvolk","id":14073052,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MDczMDUy","avatar_url":"https://avatars0.githubusercontent.com/u/14073052?v=4","gravatar_id":"","url":"https://api.github.com/users/kinvolk","html_url":"https://github.com/kinvolk","followers_url":"https://api.github.com/users/kinvolk/followers","following_url":"https://api.github.com/users/kinvolk/following{/other_user}","gists_url":"https://api.github.com/users/kinvolk/gists{/gist_id}","starred_url":"https://api.github.com/users/kinvolk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kinvolk/subscriptions","organizations_url":"https://api.github.com/users/kinvolk/orgs","repos_url":"https://api.github.com/users/kinvolk/repos","events_url":"https://api.github.com/users/kinvolk/events{/privacy}","received_events_url":"https://api.github.com/users/kinvolk/received_events","type":"Organization","site_admin":false},"repo":{"id":78522032,"node_id":"MDEwOlJlcG9zaXRvcnk3ODUyMjAzMg==","name":"kube-spawn","full_name":"kinvolk/kube-spawn","owner":{"login":"kinvolk","id":14073052,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MDczMDUy","avatar_url":"https://avatars0.githubusercontent.com/u/14073052?v=4","gravatar_id":"","url":"https://api.github.com/users/kinvolk","html_url":"https://github.com/kinvolk","followers_url":"https://api.github.com/users/kinvolk/followers","following_url":"https://api.github.com/users/kinvolk/following{/other_user}","gists_url":"https://api.github.com/users/kinvolk/gists{/gist_id}","starred_url":"https://api.github.com/users/kinvolk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kinvolk/subscriptions","organizations_url":"https://api.github.com/users/kinvolk/orgs","repos_url":"https://api.github.com/users/kinvolk/repos","events_url":"https://api.github.com/users/kinvolk/events{/privacy}","received_events_url":"https://api.github.com/users/kinvolk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kinvolk/kube-spawn","description":"A tool for creating multi-node Kubernetes clusters on a Linux machine using kubeadm & systemd-nspawn. Brought to you by the Kinvolk team.","fork":false,"url":"https://api.github.com/repos/kinvolk/kube-spawn","forks_url":"https://api.github.com/repos/kinvolk/kube-spawn/forks","keys_url":"https://api.github.com/repos/kinvolk/kube-spawn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kinvolk/kube-spawn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kinvolk/kube-spawn/teams","hooks_url":"https://api.github.com/repos/kinvolk/kube-spawn/hooks","issue_events_url":"https://api.github.com/repos/kinvolk/kube-spawn/issues/events{/number}","events_url":"https://api.github.com/repos/kinvolk/kube-spawn/events","assignees_url":"https://api.github.com/repos/kinvolk/kube-spawn/assignees{/user}","branches_url":"https://api.github.com/repos/kinvolk/kube-spawn/branches{/branch}","tags_url":"https://api.github.com/repos/kinvolk/kube-spawn/tags","blobs_url":"https://api.github.com/repos/kinvolk/kube-spawn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kinvolk/kube-spawn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kinvolk/kube-spawn/git/refs{/sha}","trees_url":"https://api.github.com/repos/kinvolk/kube-spawn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kinvolk/kube-spawn/statuses/{sha}","languages_url":"https://api.github.com/repos/kinvolk/kube-spawn/languages","stargazers_url":"https://api.github.com/repos/kinvolk/kube-spawn/stargazers","contributors_url":"https://api.github.com/repos/kinvolk/kube-spawn/contributors","subscribers_url":"https://api.github.com/repos/kinvolk/kube-spawn/subscribers","subscription_url":"https://api.github.com/repos/kinvolk/kube-spawn/subscription","commits_url":"https://api.github.com/repos/kinvolk/kube-spawn/commits{/sha}","git_commits_url":"https://api.github.com/repos/kinvolk/kube-spawn/git/commits{/sha}","comments_url":"https://api.github.com/repos/kinvolk/kube-spawn/comments{/number}","issue_comment_url":"https://api.github.com/repos/kinvolk/kube-spawn/issues/comments{/number}","contents_url":"https://api.github.com/repos/kinvolk/kube-spawn/contents/{+path}","compare_url":"https://api.github.com/repos/kinvolk/kube-spawn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kinvolk/kube-spawn/merges","archive_url":"https://api.github.com/repos/kinvolk/kube-spawn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kinvolk/kube-spawn/downloads","issues_url":"https://api.github.com/repos/kinvolk/kube-spawn/issues{/number}","pulls_url":"https://api.github.com/repos/kinvolk/kube-spawn/pulls{/number}","milestones_url":"https://api.github.com/repos/kinvolk/kube-spawn/milestones{/number}","notifications_url":"https://api.github.com/repos/kinvolk/kube-spawn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kinvolk/kube-spawn/labels{/name}","releases_url":"https://api.github.com/repos/kinvolk/kube-spawn/releases{/id}","deployments_url":"https://api.github.com/repos/kinvolk/kube-spawn/deployments","created_at":"2017-01-10T10:16:39Z","updated_at":"2018-08-22T10:43:13Z","pushed_at":"2018-08-22T12:05:40Z","git_url":"git://github.com/kinvolk/kube-spawn.git","ssh_url":"git@github.com:kinvolk/kube-spawn.git","clone_url":"https://github.com/kinvolk/kube-spawn.git","svn_url":"https://github.com/kinvolk/kube-spawn","homepage":"https://kinvolk.io","size":13919,"stargazers_count":219,"watchers_count":219,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"archived":false,"open_issues_count":42,"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":15,"open_issues":42,"watchers":219,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kinvolk/kube-spawn/pulls/300"},"html":{"href":"https://github.com/kinvolk/kube-spawn/pull/300"},"issue":{"href":"https://api.github.com/repos/kinvolk/kube-spawn/issues/300"},"comments":{"href":"https://api.github.com/repos/kinvolk/kube-spawn/issues/300/comments"},"review_comments":{"href":"https://api.github.com/repos/kinvolk/kube-spawn/pulls/300/comments"},"review_comment":{"href":"https://api.github.com/repos/kinvolk/kube-spawn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kinvolk/kube-spawn/pulls/300/commits"},"statuses":{"href":"https://api.github.com/repos/kinvolk/kube-spawn/statuses/bad929a9fbb2acb1e5f8faf7241bb031e13be2ed"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"donbowman"}}