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

Add traffic splitter API kind #1213

Merged
merged 45 commits into from
Jul 30, 2020
Merged

Add traffic splitter API kind #1213

merged 45 commits into from
Jul 30, 2020

Conversation

tthebst
Copy link
Contributor

@tthebst tthebst commented Jul 8, 2020

closes #1132, closes #1089, closes #275


checklist:

  • run make test and make lint <--- some listing issue atm
  • test manually (i.e. build/push all images, restart operator, and re-deploy APIs)
  • update examples <--- todooo
  • update docs and add any new files to summary.md (view in gitbook after merging)
  • cherry-pick into release branches if applicable
  • alert the dev team if the dev environment changed

@tthebst tthebst requested review from deliahu and vishalbollu July 8, 2020 20:01
@deliahu deliahu changed the title Trafficsplit Add traffic splitter API kind Jul 9, 2020
return nil, err
}
} else if deployedResource.Kind == userconfig.APISplitterKind {
if deployedResource == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar to the comment above, this check can be removed once the if deployedResource == nil check is made before the kind specific deletions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

see other comment.


return nil, ErrorAPINotDeployed(apiName)
}

if deployedResource.Kind == userconfig.SyncAPIKind {
Copy link
Contributor

Choose a reason for hiding this comment

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

I am going back and forth on this one. As we add more kinds, this delete will get more expensive (and potentially more redundant). However, I do like the idea that if for some there is an error in the delete and the virtual service is deleted but there other dangling resources (e.g. api gateway), we can delete again to try to cleanup again.

We should bring it back to help the users cleanup resources as much as possible.

if err := isWeight100(api.APIs); err != nil {
return errors.Wrap(err, api.Identify(), userconfig.PredictorKey)
}

Copy link
Contributor

Choose a reason for hiding this comment

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

It doesn't look like we validate that the names listed in api.APIs are unique, we should validate add that validation here.

@@ -147,24 +156,45 @@ func DeleteAPI(apiName string, keepCache bool) (*schema.DeleteResponse, error) {
return nil, err
}

if deployedResource == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Based on the conversation, the "just to be sure" deletion can be brought back. Also add api splitter to the just to be sure deletion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added it back already.

Copy link
Contributor

Choose a reason for hiding this comment

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

The nil check should happen before if deployedResource.Kind == userconfig.SyncAPIKind { is called because you may run into a nil pointer exception if deployedResource is nil.

@tthebst tthebst merged commit 41e2905 into master Jul 30, 2020
@tthebst tthebst deleted the trafficsplit branch July 30, 2020 17:42
@tthebst tthebst restored the trafficsplit branch July 30, 2020 17:42
tthebst added a commit that referenced this pull request Jul 30, 2020
@tthebst tthebst deleted the trafficsplit branch July 30, 2020 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support arbitrary traffic splitting Multi-armed bandit Enable A/B Testing (via traffic splitting)
2 participants