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

Support network scoped service aliases #1087

Merged
merged 15 commits into from
Dec 21, 2024

Conversation

lisongmin
Copy link
Contributor

@lisongmin lisongmin commented Dec 17, 2024

To support network scoped aliases, we using the alias option in --network.
Since the --network-alias will override the alias set by --network,
we do not using the --network-alias any more. All aliases will be set
via --network.

@lisongmin lisongmin force-pushed the feat-support-network-scoped-aliases branch 4 times, most recently from 6e388ec to a955bc8 Compare December 17, 2024 14:34
@lisongmin lisongmin marked this pull request as draft December 18, 2024 05:27
@lisongmin lisongmin force-pushed the feat-support-network-scoped-aliases branch from a955bc8 to 69ee8ab Compare December 18, 2024 07:53
@lisongmin lisongmin marked this pull request as ready for review December 18, 2024 07:54
@lisongmin lisongmin force-pushed the feat-support-network-scoped-aliases branch 4 times, most recently from 067b878 to 873c1c0 Compare December 18, 2024 08:30
lisongmin and others added 12 commits December 18, 2024 19:59
Modified-by: Povilas Kanapickas <[email protected]>
Signed-off-by: Songmin Li <[email protected]>
This commit takes into account that network_mode won't have networks
attribute set, accordingly get_net_args_from_network_mode() can
calculate complete net_args easily.

Modified-by: Povilas Kanapickas <[email protected]>
Signed-off-by: Songmin Li <[email protected]>
Modified-by: Povilas Kanapickas <[email protected]>
Signed-off-by: Songmin Li <[email protected]>
Modified-by: Povilas Kanapickas <[email protected]>
Signed-off-by: Songmin Li <[email protected]>
Modified-by: Povilas Kanapickas <[email protected]>
Signed-off-by: Songmin Li <[email protected]>
Note that multiple_nets is now guaranteed to be not empty in processing
stage.

Modified-by: Povilas Kanapickas <[email protected]>
Signed-off-by: Songmin Li <[email protected]>
The behavior has not changed, single-network has a special case.

Modified-by: Povilas Kanapickas <[email protected]>
Signed-off-by: Songmin Li <[email protected]>
@p12tic p12tic force-pushed the feat-support-network-scoped-aliases branch from 873c1c0 to 681d636 Compare December 18, 2024 18:01
@p12tic
Copy link
Collaborator

p12tic commented Dec 18, 2024

@lisongmin Thanks for the PR. I will write several comments, but overall it looks good.

Please note, that such a PR where all changes are added as a single commit is extremely hard to review. Refactoring is mixed with functionality changes and as a result I would have to replay everything in my head.

I've split the PR in small commits that refactor one thing at a time. The end result is almost the same except several deliberate changes. The functionality changes are then way smaller and way easier to review.

podman_compose.py Outdated Show resolved Hide resolved
podman_compose.py Outdated Show resolved Hide resolved
podman_compose.py Outdated Show resolved Hide resolved
@p12tic
Copy link
Collaborator

p12tic commented Dec 18, 2024

I'm looking into 22454fc to review functionality changes.

@lisongmin lisongmin force-pushed the feat-support-network-scoped-aliases branch from 681d636 to f050dac Compare December 19, 2024 03:10
@lisongmin
Copy link
Contributor Author

Done.

Sorry for the poor PR, thanks for your patience in checking the codes. I learn a lot from it.

When using bridge mode, podman-compose will use the default `podman` network.
We do not need to create this network, so just return as other network_mode.

Signed-off-by: Songmin Li <[email protected]>
@p12tic p12tic force-pushed the feat-support-network-scoped-aliases branch from f050dac to 346f7a5 Compare December 21, 2024 20:53
@p12tic p12tic merged commit 75d7be2 into containers:main Dec 21, 2024
7 checks passed
@lisongmin lisongmin deleted the feat-support-network-scoped-aliases branch December 30, 2024 15:18
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