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

skipper: refactor test options #2417

Closed
wants to merge 1 commit into from

Conversation

AlexanderYastrebov
Copy link
Member

@AlexanderYastrebov AlexanderYastrebov commented Jun 21, 2023

Remove unexported test options to allow using them outside of skipper package.

  • refactor testOptions into Options fields
  • add shutdown channels

@AlexanderYastrebov
Copy link
Member Author

This would be used by #2416

Copy link
Member

@szuecs szuecs left a comment

Choose a reason for hiding this comment

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

Do not expose channels in skipper library, because it is not a good api for library users and I don't see why we would need it.

skipper.go Show resolved Hide resolved
skipper_test.go Show resolved Hide resolved
@szuecs
Copy link
Member

szuecs commented Jun 22, 2023

We discussed that you can hopefully use export_test.go to expose an API to pass channels, if routesrv does it similar we can not use this to start both and then it's fine to pass it via Options.

Remove unexported test options to allow using them outside of skipper package.

* refactor testOptions into Options fields
* add shutdown channels

Signed-off-by: Alexander Yastrebov <alexander.yastrebov@zalando.de>
@AlexanderYastrebov
Copy link
Member Author

Do not expose channels in skipper library, because it is not a good api for library users and I don't see why we would need it.

Currently there is no way to run skipper within the same process (e.g. from the test) and properly shutdown it because it only shuts down on SIGTERM.

This change does not expose any internal channels but allows user to specify optional channels to trigger and signal shutdown.

@AlexanderYastrebov
Copy link
Member Author

if routesrv does it similar

routesrv also does not support programmatic shutdown atm

@AlexanderYastrebov
Copy link
Member Author

We need to think more about programmatic shutdown for both skipper and routesrv.
Besides adding channels to options we may add exported RunWithShutdown functions.

Closing this for now in favor of #2419

@AlexanderYastrebov AlexanderYastrebov deleted the skipper/remove-test-options branch June 22, 2023 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants