Skip to content

secondary networks for servers#185

Open
hown3d wants to merge 2 commits into
mainfrom
secondary-networks
Open

secondary networks for servers#185
hown3d wants to merge 2 commits into
mainfrom
secondary-networks

Conversation

@hown3d

@hown3d hown3d commented Jul 6, 2026

Copy link
Copy Markdown
Member

How to categorize this PR?

/kind enhancement

What this PR does / why we need it:
Support multiple additional networks for a server.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Breaking changes:

@ske-prow ske-prow Bot added the kind/enhancement Enhancement, improvement, extension label Jul 6, 2026
@ske-prow

ske-prow Bot commented Jul 6, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign xoxys for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ske-prow ske-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 6, 2026
Signed-off-by: Lukas Hoehl <lukas.hoehl@stackit.cloud>
@hown3d hown3d force-pushed the secondary-networks branch from 3913699 to d849c35 Compare July 6, 2026 14:55
@mstueer

mstueer commented Jul 7, 2026

Copy link
Copy Markdown

Looks fine, but tests are missing?

Signed-off-by: Lukas Hoehl <lukas.hoehl@stackit.cloud>
@ske-prow ske-prow Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 7, 2026
@hown3d

hown3d commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

I added some tests

Comment thread pkg/provider/apis/validation/validation.go
Comment thread docs/machine-class.md

## NetworkingSpec

Exactly one of the following must be set:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This needs to be rephrased.
networkid / nicids is mutually exclusive while secondarynetworkids is additional

}
}

for i, secondaryNet := range networking.SecondaryNetworkIDs {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also add a check that the list contains unique networkIDs and that they are not equal to the "primary" networkID (if set)

Comment thread pkg/provider/create.go
return nil, status.Error(codes.Unavailable, fmt.Sprintf("failed to patch NICs for server: %v", err))
}

if providerSpec.Networking != nil && len(providerSpec.Networking.SecondaryNetworkIDs) > 0 {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

doesn't this has to happen before patching the networkinterfaces?

if this happens after patchNetworkInterface, the address from the new interface is not reflected in the CreateMachineResponse.Addresses and also it does not get the allowedAddresses patched.

This also means in the ensureAdditionalNetworks we have to attach the network and then wait until all networks are attached since this operation is async.
If we do not wait until all networks are attached, the patch function could skip some nics.

All this "waiting" feels a little cumbersome but its just how the create interface is designed. One call to rule em all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement Enhancement, improvement, extension size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants