-
Notifications
You must be signed in to change notification settings - Fork 52
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
fix: create lattice resources when no endpoints in K8s services (#386) #406
Conversation
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.
approving with minor comment
@@ -96,6 +97,11 @@ func (s *defaultTargetsManager) Create(ctx context.Context, targets *latticemode | |||
targetList = append(targetList, &t) | |||
} | |||
|
|||
if len(targetList) == 0 { | |||
glog.Warningln("There are no available targets to regiser. Skipping targets registration") |
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.
IMO I don't think we need this log line
It("Create lattice resources successfully when no Targets available", func() { | ||
httpRoute = testFramework.NewHttpRoute(testGateway, service, "Service") | ||
|
||
// Override port |
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.
Do you need to add more comments here to say that you override the httproute port to cause no port match so that it will cause no Targets in the TG? Or use a more explicit way to construct a no targetPort k8sService?
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 can add more comments. I doubt creating "no targetPort" K8s service will be used in other place so it will be over-kill to create a method to do that.
Pull Request Test Coverage Report for Build 6253438117
💛 - Coveralls |
What type of PR is this?
bug
Which issue does this PR fix:
#386
What does this PR do / Why do we need it:
This PR allows the controller to continue to create Lattice service, and listeners, and rules when there are no targets to register
If an issue # is not available please add repro steps and logs from aws-gateway-controller showing the issue:
Testing done on this change:
Added unit tests, and e2e tests.
make e2e-test
output:Automation added to e2e:
Added test case
httproute_creation_test.go
Will this PR introduce any new dependencies?: No
Will this break upgrades or downgrades. Has updating a running cluster been tested?: No
Does this PR introduce any user-facing change?: No
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.