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

Add interface to customize CreateContainerCmd #7421

Merged
merged 8 commits into from Aug 21, 2023

Conversation

eddumelendez
Copy link
Member

@eddumelendez eddumelendez commented Aug 17, 2023

Add CreateContainerCmdModifier interface to customize
CreateContainerCmd via SPI (global customization). Also,
withCreateContainerCmdModifier can be used too for local
customization.

Customization is applied after Testcontainers configuration is set.

@eddumelendez eddumelendez requested a review from a team as a code owner August 17, 2023 18:42
@eddumelendez eddumelendez added this to the next milestone Aug 17, 2023
Add `CreateContainerCmdCustomizer` interface to customize
`CreateContainerCmd`. Customization is applied after Testcontainers
configuration is set.
@eddumelendez eddumelendez changed the title Add interface to customize CreateContainerCmd via SPI Add interface to customize CreateContainerCmd Aug 17, 2023
@@ -1495,6 +1510,11 @@ public SELF withCreateContainerCmdModifier(Consumer<CreateContainerCmd> modifier
return self();
}

public SELF withCreateContainerCmdCustomizer(CreateContainerCmdCustomizer customizer) {
Copy link
Member

Choose a reason for hiding this comment

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

We should think about either deprecating withCreateContainerCmdModifier or adding an overload, to avoid increasing the API surface. Maybe, as a first step, we could keep withCreateContainerCmdModifier only but make it populate localCreateContainerCustomizers?

Also, if we name it CreateContainerCmdModifier, then we could align both APIs and not have to deprecate the old one (just thinking out loud...) - WDYT?

Copy link
Member Author

Choose a reason for hiding this comment

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

looks like I forgot something when trying to overload withCreateContainerCmdModifier 🙈. Now, this is done. My only question is about the location where createContainerCmdCustomizers is being called because createContainerCmdModifiers is currently called before. I think the current implementation is ok and we should drop createContainerCmdModifiers references due to are not being used.

@eddumelendez eddumelendez merged commit d9519f9 into main Aug 21, 2023
87 checks passed
@eddumelendez eddumelendez deleted the createcontainercmdcustomizer branch August 21, 2023 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants