Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

[OBS-137] Handle 409 response of create service to again check for service #232

Merged
merged 1 commit into from
Sep 14, 2023

Conversation

mudit-postman
Copy link
Contributor

  • Create a new model to parse error response
  • Handle the 409 conflict case. Check for error message and call get services again
  • Try only one time after that bail out with error
  • Other small fixes: Add to cache after create service flow, small model change

@shreys7 shreys7 changed the title [OBS-137] Handle 403 response of create service to again check for service [OBS-137] Handle 409 response of create service to again check for service Sep 14, 2023

if httpErr, ok := err.(rest.HTTPError); ok && httpErr.StatusCode == 403 {
error := fmt.Errorf("You cannot send traffic to the collection with ID %s. "+
if httpErr.StatusCode == 409 && errorResponse.Message == "collection_already_mapped" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment explaining the use case which requires this (a race between multiple agents trying to create the mirrored service.)

@mgritter
Copy link
Contributor

Merging so we can build a new agent release this morning

@mgritter mgritter merged commit e4b857e into main Sep 14, 2023
@mgritter mgritter deleted the bugfix/OBS-137 branch September 14, 2023 16:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants