feat: support pattern link aliases#12723
Closed
nberlee wants to merge 1 commit intosiderolabs:mainfrom
Closed
Conversation
This adds two new selector options to `LinkAliasConfig`:
- `requireUniqueMatch` (default: true): When false, allows the selector
to match multiple links and uses the first matching link.
- `skipAliasedLinks` (default: false): When true, skips links that
already have an alias from a previous config.
These options enable creating sequential aliases like `net0` and `net1`
from any N random links, which is useful for bonding/bridging setups
where consistent interface naming is needed regardless of physical
hardware.
Example:
```yaml
apiVersion: v1alpha1
kind: LinkAliasConfig
name: net0
selector:
match: link.type == 1
requireUniqueMatch: false
---
apiVersion: v1alpha1
kind: LinkAliasConfig
name: net1
selector:
match: link.type == 1
requireUniqueMatch: false
skipAliasedLinks: true
```
Closes siderolabs#12718
Signed-off-by: Nico Berlee <nico.berlee@on2it.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
What? (description)
Add pattern-based
LinkAliasConfignames (e.g.net%d) to create sequential aliases across multiple matching links, sorted by link name.Why? (reasoning)
This matches the requested behavior for multi-link aliases, allowing one config to generate
net0,net1, ... in deterministic order, with automatic reconciliation when links change. Closes #12718Acceptance
Please use the following checklist:
make conformance)make fmt)make lint)make docs)make unit-tests)