Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return 409 conflict on origin create when existing #843

Merged
merged 1 commit into from
Jun 14, 2016

Conversation

reset
Copy link
Collaborator

@reset reset commented Jun 14, 2016

  • Add ENTITY_CONFLICT net error
  • Switch from returning an ACCESS_DENIED net error to ENTITY_CONFLICT when origin create fails due to a pre-existing origin of the same name
  • Return a 409 status code when creating an origin and it already exists from a 500

gif-keyboard-5658559095285873332

Signed-off-by: Jamie Winsor [email protected]

@smith
Copy link
Contributor

smith commented Jun 14, 2016

Makes it work perfectly!

DEBUG:hyper::net: http scheme
↑ Uploading public key /Users/nathansmith/.hab/cache/keys/smith-20160612192909.pub
DEBUG:hyper::net: http scheme
DEBUG:hyper::http::h1: request line: Post "/v1/depot/origins/smith/keys/20160612192909" Http11
DEBUG:hyper::http::h1: headers=Headers { Authorization: Bearer 11a997b3a9b94b435fd268ceb6f878d50c1457dd, Host: localhost:9636, Content-Length: 76, }
    76 B / 76 B | [====================================================================================================] 100.00 % 24.37 KB/s  DEBUG:hyper::client::response: version=Http11, status=Conflict
DEBUG:hyper::client::response: headers=Headers { Date: Tue, 14 Jun 2016 18:44:49 GMT, Access-Control-Allow-Origin: *, Content-Length: 0, Access-Control-Expose-Headers: content-range, next-range, Access-Control-Allow-Headers: authorization, range, }
DEBUG:hab::command::origin::key::upload_latest: Error uploading public key 409 Conflict
✓ Public key revision already exists in the depot smith-20160612192909
★ Upload of public origin key smith-20160612192909 complete.

gif-keyboard-14064659742428749629

@thesentinels r+

@thesentinels
Copy link
Contributor

📌 Commit fc694b0 has been approved by smith

@thesentinels
Copy link
Contributor

⌛ Testing commit fc694b0 with merge 1553862...

thesentinels pushed a commit that referenced this pull request Jun 14, 2016
Signed-off-by: Jamie Winsor <[email protected]>

Pull request: #843
Approved by: smith
@thesentinels
Copy link
Contributor

☀️ Test successful - travis

@thesentinels thesentinels merged commit fc694b0 into master Jun 14, 2016
@reset reset deleted the fix-return-code branch June 14, 2016 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants