{"action":"created","comment":{"url":"https://api.github.com/repos/juju/juju/pulls/comments/191349720","pull_request_review_id":123902289,"id":191349720,"diff_hunk":"@@ -4,65 +4,981 @@\n package oci\n \n import (\n+\t\"context\"\n+\t\"fmt\"\n+\t\"net\"\n+\t\"time\"\n+\n \t\"github.com/juju/errors\"\n+\t\"github.com/juju/utils/set\"\n \t\"gopkg.in/juju/names.v2\"\n \n \t\"github.com/juju/juju/environs\"\n-\t\"github.com/juju/juju/environs/context\"\n+\tenvcontext \"github.com/juju/juju/environs/context\"\n+\t\"github.com/juju/juju/environs/tags\"\n \t\"github.com/juju/juju/instance\"\n \t\"github.com/juju/juju/network\"\n+\n+\tociCore \"github.com/oracle/oci-go-sdk/core\"\n+)\n+\n+const (\n+\t// DefaultAddressSpace is the subnet to use for the default juju VCN\n+\t// An individual subnet will be created from this class, for each\n+\t// availability domain.\n+\tDefaultAddressSpace = \"10.0.0.0/16\"\n+\n+\tSubnetPrefixLength = \"24\"\n+\n+\tVcnNamePrefix         = \"juju-vcn\"\n+\tSecListNamePrefix     = \"juju-seclist\"\n+\tSubnetNamePrefix      = \"juju-subnet\"\n+\tInternetGatewayPrefix = \"juju-ig\"\n+\tRouteTablePrefix      = \"juju-rt\"\n+)\n+\n+var (\n+\ttcpProtocolNumber  = \"6\"\n+\tudpProtocolNumber  = \"17\"\n+\ticmpProtocolNumber = \"1\"\n+\tallProtocols       = \"all\"\n )\n \n+// TODO(gsamfira): Use \"local\" instead? make configurable?\n+var DnsLabelTld = \"juju\"\n+\n+func (e *Environ) vcnName(controllerUUID string) *string {","path":"provider/oci/networking.go","position":50,"original_position":48,"commit_id":"bdf22724e554ab8d019abe680a22591290284765","original_commit_id":"643554e32fe5c8967c22eecb39fbc862c58bf3e7","user":{"login":"gabriel-samfira","id":903160,"avatar_url":"https://avatars3.githubusercontent.com/u/903160?v=4","gravatar_id":"","url":"https://api.github.com/users/gabriel-samfira","html_url":"https://github.com/gabriel-samfira","followers_url":"https://api.github.com/users/gabriel-samfira/followers","following_url":"https://api.github.com/users/gabriel-samfira/following{/other_user}","gists_url":"https://api.github.com/users/gabriel-samfira/gists{/gist_id}","starred_url":"https://api.github.com/users/gabriel-samfira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabriel-samfira/subscriptions","organizations_url":"https://api.github.com/users/gabriel-samfira/orgs","repos_url":"https://api.github.com/users/gabriel-samfira/repos","events_url":"https://api.github.com/users/gabriel-samfira/events{/privacy}","received_events_url":"https://api.github.com/users/gabriel-samfira/received_events","type":"User","site_admin":false},"body":"*sigh* missed this one.\r\n\r\n> Also consider that the Credential is associated at the Model level, as a given controller might be managing models for different users w/ different credentials.\r\n\r\nindeed. Will update scope to model for all networking resources that make sense.","created_at":"2018-05-29T08:57:28Z","updated_at":"2018-05-29T08:57:28Z","html_url":"https://github.com/juju/juju/pull/8539#discussion_r191349720","pull_request_url":"https://api.github.com/repos/juju/juju/pulls/8539","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/juju/juju/pulls/comments/191349720"},"html":{"href":"https://github.com/juju/juju/pull/8539#discussion_r191349720"},"pull_request":{"href":"https://api.github.com/repos/juju/juju/pulls/8539"}},"in_reply_to_id":190169158},"pull_request":{"url":"https://api.github.com/repos/juju/juju/pulls/8539","id":177747671,"html_url":"https://github.com/juju/juju/pull/8539","diff_url":"https://github.com/juju/juju/pull/8539.diff","patch_url":"https://github.com/juju/juju/pull/8539.patch","issue_url":"https://api.github.com/repos/juju/juju/issues/8539","number":8539,"state":"open","locked":false,"title":"Add OCI provider [5/7]","user":{"login":"gabriel-samfira","id":903160,"avatar_url":"https://avatars3.githubusercontent.com/u/903160?v=4","gravatar_id":"","url":"https://api.github.com/users/gabriel-samfira","html_url":"https://github.com/gabriel-samfira","followers_url":"https://api.github.com/users/gabriel-samfira/followers","following_url":"https://api.github.com/users/gabriel-samfira/following{/other_user}","gists_url":"https://api.github.com/users/gabriel-samfira/gists{/gist_id}","starred_url":"https://api.github.com/users/gabriel-samfira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabriel-samfira/subscriptions","organizations_url":"https://api.github.com/users/gabriel-samfira/orgs","repos_url":"https://api.github.com/users/gabriel-samfira/repos","events_url":"https://api.github.com/users/gabriel-samfira/events{/privacy}","received_events_url":"https://api.github.com/users/gabriel-samfira/received_events","type":"User","site_admin":false},"body":"This adds logic to ensure that a default network exists when we first bootstrap. Also teardown logic.\r\n\r\nDepends on: https://github.com/juju/juju/pull/8537","created_at":"2018-03-27T13:53:43Z","updated_at":"2018-05-29T08:57:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c12ff180f76283bb9a1132f5b197e80623307fd1","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/juju/juju/pulls/8539/commits","review_comments_url":"https://api.github.com/repos/juju/juju/pulls/8539/comments","review_comment_url":"https://api.github.com/repos/juju/juju/pulls/comments{/number}","comments_url":"https://api.github.com/repos/juju/juju/issues/8539/comments","statuses_url":"https://api.github.com/repos/juju/juju/statuses/bdf22724e554ab8d019abe680a22591290284765","head":{"label":"gabriel-samfira:oci-provider-networking","ref":"oci-provider-networking","sha":"bdf22724e554ab8d019abe680a22591290284765","user":{"login":"gabriel-samfira","id":903160,"avatar_url":"https://avatars3.githubusercontent.com/u/903160?v=4","gravatar_id":"","url":"https://api.github.com/users/gabriel-samfira","html_url":"https://github.com/gabriel-samfira","followers_url":"https://api.github.com/users/gabriel-samfira/followers","following_url":"https://api.github.com/users/gabriel-samfira/following{/other_user}","gists_url":"https://api.github.com/users/gabriel-samfira/gists{/gist_id}","starred_url":"https://api.github.com/users/gabriel-samfira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabriel-samfira/subscriptions","organizations_url":"https://api.github.com/users/gabriel-samfira/orgs","repos_url":"https://api.github.com/users/gabriel-samfira/repos","events_url":"https://api.github.com/users/gabriel-samfira/events{/privacy}","received_events_url":"https://api.github.com/users/gabriel-samfira/received_events","type":"User","site_admin":false},"repo":{"id":20686648,"name":"juju","full_name":"gabriel-samfira/juju","owner":{"login":"gabriel-samfira","id":903160,"avatar_url":"https://avatars3.githubusercontent.com/u/903160?v=4","gravatar_id":"","url":"https://api.github.com/users/gabriel-samfira","html_url":"https://github.com/gabriel-samfira","followers_url":"https://api.github.com/users/gabriel-samfira/followers","following_url":"https://api.github.com/users/gabriel-samfira/following{/other_user}","gists_url":"https://api.github.com/users/gabriel-samfira/gists{/gist_id}","starred_url":"https://api.github.com/users/gabriel-samfira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabriel-samfira/subscriptions","organizations_url":"https://api.github.com/users/gabriel-samfira/orgs","repos_url":"https://api.github.com/users/gabriel-samfira/repos","events_url":"https://api.github.com/users/gabriel-samfira/events{/privacy}","received_events_url":"https://api.github.com/users/gabriel-samfira/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gabriel-samfira/juju","description":"juju is devops distilled","fork":true,"url":"https://api.github.com/repos/gabriel-samfira/juju","forks_url":"https://api.github.com/repos/gabriel-samfira/juju/forks","keys_url":"https://api.github.com/repos/gabriel-samfira/juju/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gabriel-samfira/juju/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gabriel-samfira/juju/teams","hooks_url":"https://api.github.com/repos/gabriel-samfira/juju/hooks","issue_events_url":"https://api.github.com/repos/gabriel-samfira/juju/issues/events{/number}","events_url":"https://api.github.com/repos/gabriel-samfira/juju/events","assignees_url":"https://api.github.com/repos/gabriel-samfira/juju/assignees{/user}","branches_url":"https://api.github.com/repos/gabriel-samfira/juju/branches{/branch}","tags_url":"https://api.github.com/repos/gabriel-samfira/juju/tags","blobs_url":"https://api.github.com/repos/gabriel-samfira/juju/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gabriel-samfira/juju/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gabriel-samfira/juju/git/refs{/sha}","trees_url":"https://api.github.com/repos/gabriel-samfira/juju/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gabriel-samfira/juju/statuses/{sha}","languages_url":"https://api.github.com/repos/gabriel-samfira/juju/languages","stargazers_url":"https://api.github.com/repos/gabriel-samfira/juju/stargazers","contributors_url":"https://api.github.com/repos/gabriel-samfira/juju/contributors","subscribers_url":"https://api.github.com/repos/gabriel-samfira/juju/subscribers","subscription_url":"https://api.github.com/repos/gabriel-samfira/juju/subscription","commits_url":"https://api.github.com/repos/gabriel-samfira/juju/commits{/sha}","git_commits_url":"https://api.github.com/repos/gabriel-samfira/juju/git/commits{/sha}","comments_url":"https://api.github.com/repos/gabriel-samfira/juju/comments{/number}","issue_comment_url":"https://api.github.com/repos/gabriel-samfira/juju/issues/comments{/number}","contents_url":"https://api.github.com/repos/gabriel-samfira/juju/contents/{+path}","compare_url":"https://api.github.com/repos/gabriel-samfira/juju/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gabriel-samfira/juju/merges","archive_url":"https://api.github.com/repos/gabriel-samfira/juju/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gabriel-samfira/juju/downloads","issues_url":"https://api.github.com/repos/gabriel-samfira/juju/issues{/number}","pulls_url":"https://api.github.com/repos/gabriel-samfira/juju/pulls{/number}","milestones_url":"https://api.github.com/repos/gabriel-samfira/juju/milestones{/number}","notifications_url":"https://api.github.com/repos/gabriel-samfira/juju/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gabriel-samfira/juju/labels{/name}","releases_url":"https://api.github.com/repos/gabriel-samfira/juju/releases{/id}","deployments_url":"https://api.github.com/repos/gabriel-samfira/juju/deployments","created_at":"2014-06-10T13:41:36Z","updated_at":"2016-11-15T16:15:59Z","pushed_at":"2018-05-28T17:39:57Z","git_url":"git://github.com/gabriel-samfira/juju.git","ssh_url":"git@github.com:gabriel-samfira/juju.git","clone_url":"https://github.com/gabriel-samfira/juju.git","svn_url":"https://github.com/gabriel-samfira/juju","homepage":"juju.ubuntu.com","size":206510,"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":2,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0"},"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"juju:develop","ref":"develop","sha":"f92a1605f6763e6b78371fd8823e4817442bc255","user":{"login":"juju","id":4604548,"avatar_url":"https://avatars0.githubusercontent.com/u/4604548?v=4","gravatar_id":"","url":"https://api.github.com/users/juju","html_url":"https://github.com/juju","followers_url":"https://api.github.com/users/juju/followers","following_url":"https://api.github.com/users/juju/following{/other_user}","gists_url":"https://api.github.com/users/juju/gists{/gist_id}","starred_url":"https://api.github.com/users/juju/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juju/subscriptions","organizations_url":"https://api.github.com/users/juju/orgs","repos_url":"https://api.github.com/users/juju/repos","events_url":"https://api.github.com/users/juju/events{/privacy}","received_events_url":"https://api.github.com/users/juju/received_events","type":"Organization","site_admin":false},"repo":{"id":20445947,"name":"juju","full_name":"juju/juju","owner":{"login":"juju","id":4604548,"avatar_url":"https://avatars0.githubusercontent.com/u/4604548?v=4","gravatar_id":"","url":"https://api.github.com/users/juju","html_url":"https://github.com/juju","followers_url":"https://api.github.com/users/juju/followers","following_url":"https://api.github.com/users/juju/following{/other_user}","gists_url":"https://api.github.com/users/juju/gists{/gist_id}","starred_url":"https://api.github.com/users/juju/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juju/subscriptions","organizations_url":"https://api.github.com/users/juju/orgs","repos_url":"https://api.github.com/users/juju/repos","events_url":"https://api.github.com/users/juju/events{/privacy}","received_events_url":"https://api.github.com/users/juju/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/juju/juju","description":"juju is devops distilled","fork":false,"url":"https://api.github.com/repos/juju/juju","forks_url":"https://api.github.com/repos/juju/juju/forks","keys_url":"https://api.github.com/repos/juju/juju/keys{/key_id}","collaborators_url":"https://api.github.com/repos/juju/juju/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/juju/juju/teams","hooks_url":"https://api.github.com/repos/juju/juju/hooks","issue_events_url":"https://api.github.com/repos/juju/juju/issues/events{/number}","events_url":"https://api.github.com/repos/juju/juju/events","assignees_url":"https://api.github.com/repos/juju/juju/assignees{/user}","branches_url":"https://api.github.com/repos/juju/juju/branches{/branch}","tags_url":"https://api.github.com/repos/juju/juju/tags","blobs_url":"https://api.github.com/repos/juju/juju/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/juju/juju/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/juju/juju/git/refs{/sha}","trees_url":"https://api.github.com/repos/juju/juju/git/trees{/sha}","statuses_url":"https://api.github.com/repos/juju/juju/statuses/{sha}","languages_url":"https://api.github.com/repos/juju/juju/languages","stargazers_url":"https://api.github.com/repos/juju/juju/stargazers","contributors_url":"https://api.github.com/repos/juju/juju/contributors","subscribers_url":"https://api.github.com/repos/juju/juju/subscribers","subscription_url":"https://api.github.com/repos/juju/juju/subscription","commits_url":"https://api.github.com/repos/juju/juju/commits{/sha}","git_commits_url":"https://api.github.com/repos/juju/juju/git/commits{/sha}","comments_url":"https://api.github.com/repos/juju/juju/comments{/number}","issue_comment_url":"https://api.github.com/repos/juju/juju/issues/comments{/number}","contents_url":"https://api.github.com/repos/juju/juju/contents/{+path}","compare_url":"https://api.github.com/repos/juju/juju/compare/{base}...{head}","merges_url":"https://api.github.com/repos/juju/juju/merges","archive_url":"https://api.github.com/repos/juju/juju/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/juju/juju/downloads","issues_url":"https://api.github.com/repos/juju/juju/issues{/number}","pulls_url":"https://api.github.com/repos/juju/juju/pulls{/number}","milestones_url":"https://api.github.com/repos/juju/juju/milestones{/number}","notifications_url":"https://api.github.com/repos/juju/juju/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/juju/juju/labels{/name}","releases_url":"https://api.github.com/repos/juju/juju/releases{/id}","deployments_url":"https://api.github.com/repos/juju/juju/deployments","created_at":"2014-06-03T14:28:10Z","updated_at":"2018-05-28T21:52:50Z","pushed_at":"2018-05-29T07:29:27Z","git_url":"git://github.com/juju/juju.git","ssh_url":"git@github.com:juju/juju.git","clone_url":"https://github.com/juju/juju.git","svn_url":"https://github.com/juju/juju","homepage":"juju.ubuntu.com","size":211386,"stargazers_count":1164,"watchers_count":1164,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":270,"mirror_url":null,"archived":false,"open_issues_count":17,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0"},"forks":270,"open_issues":17,"watchers":1164,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/juju/juju/pulls/8539"},"html":{"href":"https://github.com/juju/juju/pull/8539"},"issue":{"href":"https://api.github.com/repos/juju/juju/issues/8539"},"comments":{"href":"https://api.github.com/repos/juju/juju/issues/8539/comments"},"review_comments":{"href":"https://api.github.com/repos/juju/juju/pulls/8539/comments"},"review_comment":{"href":"https://api.github.com/repos/juju/juju/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/juju/juju/pulls/8539/commits"},"statuses":{"href":"https://api.github.com/repos/juju/juju/statuses/bdf22724e554ab8d019abe680a22591290284765"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"gabriel-samfira"}}