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

chore: support kbagent multi ports allocate hostnetwork port #8565

Merged
merged 4 commits into from
Dec 3, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions controllers/apps/transformer_component_hostnetwork.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,12 @@ func (t *componentHostNetworkTransformer) Transform(ctx graph.TransformContext,
func allocateHostPorts(synthesizedComp *component.SynthesizedComponent) (map[string]map[string]int32, error) {
ports := map[string]map[string]bool{}
for _, c := range synthesizedComp.HostNetwork.ContainerPorts {
containerPorts := map[string]bool{}
for _, p := range c.Ports {
containerPorts[p] = true
if _, ok := ports[c.Container]; !ok {
ports[c.Container] = map[string]bool{}
}
ports[c.Container][p] = true
}
ports[c.Container] = containerPorts
}

pm := intctrlutil.GetPortManager()
Expand Down
Loading