-
Notifications
You must be signed in to change notification settings - Fork 36
Feature: Serverless Endpoint #193
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
Feature: Serverless Endpoint #193
Conversation
"MemorySizeInMB": 1024 | ||
}, | ||
"VariantName": "AllTraffic", | ||
"VolumeSizeInGB": 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, lets try to also get answer from service team on why the behavior is like this? wouldnt it confuse the user
if ackcompare.IsNotNil(a.ko.Spec.ProductionVariants) && ackcompare.IsNotNil(a.ko.Spec.ProductionVariants) { | ||
if len(a.ko.Spec.ProductionVariants) == len(b.ko.Spec.ProductionVariants) { | ||
for i, _ := range a.ko.Spec.ProductionVariants { | ||
if a.ko.Spec.ProductionVariants[i].VolumeSizeInGB == nil && b.ko.Spec.ProductionVariants[i].VolumeSizeInGB != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets add another check here, do it only if variant.ServerlessConfig != nil
?
nit: add a comment here for why we have custom code, since server side default doesn't handle slices
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
if ackcompare.IsNotNil(a.ko.Spec.ProductionVariants) && ackcompare.IsNotNil(a.ko.Spec.ProductionVariants) { | ||
if len(a.ko.Spec.ProductionVariants) == len(b.ko.Spec.ProductionVariants) { | ||
for i, _ := range a.ko.Spec.ProductionVariants { | ||
if a.ko.Spec.ProductionVariants[i].ServerlessConfig != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this can be one if statement
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ananth102, surajkota The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Issue #, if available: Description of changes: This pull request contains code/unit tests for the Serverless Endpoint. Changes made: `generator.yaml` - Uncommenting shape and adding hook. `pkg/resource/endpoint_config/custom_delta.go` - Code that handles server side default. Late initialization isnt possible because this field is an array. `testdata/` - Unit tests The Server returns a value for VolumeSizeInGB despite it being a parameter the user cannot even specify while using a serverless endpoint. The same problem is not there for an instance based endpoint config. Manual testing (Will delete this before merge): Endpoint Config: [Serverless] Async Conifg - Validation Exception [Serverless] Multi Variant - Validation Exception [Serverless] Data Capture - Validation Exception [Serverless] Including VolumeSizeInGB in spec: Validation exception [Serverless] No VolumeSizeInGB: Normal reconciliation, no errors after restart. [Normal] No VolumeSizeInGB - Normal reconciliation, no errors after restart. [Normal] VolumeSizeInGB - Normal reconciliation, no errors after restart. Endpoint: Launching Serverless: Works, user sees information in PendingDeploymentSummary Updating Instance→ Serverless: Validation Exception Updating Serverless → Instance: Production variant must have a different name, works. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Issue #, if available:
Description of changes:
This pull request contains code/unit tests for the Serverless Endpoint.
Changes made:
generator.yaml
- Uncommenting shape and adding hook.pkg/resource/endpoint_config/custom_delta.go
- Code that handles server side default. Late initialization isnt possible because this field is an array.testdata/
- Unit testsThe Server returns a value for VolumeSizeInGB despite it being a parameter the user cannot even specify while using a serverless endpoint. The same problem is not there for an instance based endpoint config.
Manual testing (Will delete this before merge):
Endpoint Config:
[Serverless] Async Conifg - Validation Exception
[Serverless] Multi Variant - Validation Exception
[Serverless] Data Capture - Validation Exception
[Serverless] Including VolumeSizeInGB in spec: Validation exception
[Serverless] No VolumeSizeInGB: Normal reconciliation, no errors after restart.
[Normal] No VolumeSizeInGB - Normal reconciliation, no errors after restart.
[Normal] VolumeSizeInGB - Normal reconciliation, no errors after restart.
Endpoint:
Launching Serverless: Works, user sees information in PendingDeploymentSummary
Updating Instance→ Serverless: Validation Exception
Updating Serverless → Instance: Production variant must have a different name, works.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.