Thanks to visit codestin.com
Credit goes to github.com

Skip to content

use ContainerConfiguration object for LocalstackContainer #8771

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

Merged
merged 2 commits into from
Jul 31, 2023

Conversation

thrau
Copy link
Member

@thrau thrau commented Jul 30, 2023

Motivation

There was a long standing TODO in the LocalstackContainer class: # TODO merge with docker_utils.py:ContainerConfiguration, which this PR fixes. This will be useful as we use the LocalstackContainer object as an abstraction for the bootstrap tests (cc @simonrw).
Also, I want to add some flags to the localstack start command (like --network to specify the container network the container should be started in), and this will make it a bit cleaner to do that.

Changes

  • Introduced def run_container_from_config(self, container_config: ContainerConfiguration) -> Tuple[bytes, bytes]: to container client. adapted from the already existing create_container_from_config
  • Refactored LocalstackContainer to use the ContainerConfiguration object internally to hold its configuration
  • I was too lazy to refactor the config hooks, so i exposed a few of the config values through the LocalstackContainer as properties. This way it's also fully compatible with the ext container hooks and requires no changes there. The additional_flags thing is a bit of a mess.

@coveralls
Copy link

coveralls commented Jul 30, 2023

Coverage Status

coverage: 82.721% (+0.004%) from 82.717% when pulling ab67e3d on localstack-container-config into 63525d9 on master.

@thrau thrau added the semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases label Jul 30, 2023
@github-actions
Copy link

github-actions bot commented Jul 30, 2023

LocalStack Community integration with Pro

       2 files         2 suites   1h 35m 20s ⏱️
2 277 tests 1 917 ✔️ 360 💤 0
2 278 runs  1 917 ✔️ 361 💤 0

Results for commit ab67e3d.

♻️ This comment has been updated with latest results.

@thrau thrau added this to the 2.3 milestone Jul 30, 2023
Copy link
Member

@dfangl dfangl left a comment

Choose a reason for hiding this comment

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

LGTM! I agree, that we should migrate at least the additional flags to proper container configuration soon!

@thrau thrau merged commit 3259491 into master Jul 31, 2023
@thrau thrau deleted the localstack-container-config branch July 31, 2023 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants