-
Notifications
You must be signed in to change notification settings - Fork 403
Contract test between api-gateway and serverless #17894
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
Conversation
✅ Deploy Preview for kyma-project-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Skipping CI for Draft Pull Request. |
/test all |
return errors.Wrap(err, "while trying to get service") | ||
} | ||
|
||
pods, err := d.client.Pods(d.namespace).List(context.Background(), metav1.ListOptions{LabelSelector: resourceLabel}) |
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.
We can implement such selector:
kubectl get pod -n test-simple-tracing-11h22m49s -l serverless.kyma-project.io/function-name=nodejs16,serverless.kyma-project.io/resource=deployment
/test all |
|
||
for _, label := range requiredLabels { | ||
if _, exists := labels[label]; !exists { | ||
return errors.New(fmt.Sprintf("Label %s is missing", label)) |
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.
We can gather all errors by using https://pkg.go.dev/errors#Join
if val == v { | ||
delete(service.Spec.Selector, k) | ||
} else { | ||
return errors.Errorf("Expected %s but got %s", v, val) |
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.
We can gather all errors by using https://pkg.go.dev/errors#Join
|
||
err = checkIfRequiredLabelsExists(svc.Spec.Selector, true) | ||
if err != nil { | ||
return errors.Wrap(err, " in service") |
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.
I think you should write it in such way: errors.Wrap(err, "while checking the service labels
/test all |
/retest |
/retest |
Description
Kubernetes resources produced by serverless must satisfy API-gateway label selectors so that when istio and api-gateway are installed, user may add a sidecar to the function pod and expose its API.
Changes proposed in this pull request:
Pod
andService
are the sameRelated issue(s)
#17506