Repository navigation
Conversation
Lets an operator allow machines to be connected to a single switch, e.g. in single-leaf partitions. Default false keeps the requirement of exactly two switches. Settable via the admin SwitchService Update. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
majst01
reviewed
Nov 6, 2026
| // SwitchOs is the OS running on the switch. | ||
| optional metalstack.api.v2.SwitchOS os = 10; | ||
| // DisableDualMachineConnections allows machines to be connected to this switch only, without a twin switch. | ||
| optional bool disable_dual_machine_connections = 11; |
Contributor
There was a problem hiding this comment.
IMHO adding boolean flags to a API would end up in a bunch of such. I wonder if a Slice of Feature Flags would be more appropriate and extendable.
rough sample located in api/v2/switch.proto:
enum SwitchFeature {
SWITCH_FEATURE_UNSPECIFIED = 0;
SWITCH_FEATURE_SINGLE_MACHINE_CONNECTION_ALLOWED = 1;
SWITCH_FEATURE_DISABLE_ZTP = 2;
}
# in admin|api/v2/switch.proto
message Switch {
.....
repeated metalstack.api.v2.SwitchFeature features = 11;
}
Contributor
There was a problem hiding this comment.
After thinking again, we should double check if this is not better a feature of a Port, especially with MEP-17 in Mind.
Overall, making this an API exposed feature flag i like much more.
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.
Description
Adds a per-switch field
disable_dual_machine_connections(defaultfalse), as suggested in metal-stack/metal-apiserver#360 (comment):metalstack.api.v2.Switch.disable_dual_machine_connectionsmetalstack.admin.v2.SwitchServiceUpdateRequest.disable_dual_machine_connections(optional), so an operator can toggle itWhen set, metal-apiserver lets a machine register while connected to this switch only, e.g. in single-leaf partitions such as hardware labs. With the default, machines must still be connected to exactly two switches. The implementation is in metal-stack/metal-apiserver#360.
Used AI-Tools ✨
🤖 Generated with Claude Code