Skip to content

Commit

Permalink
[api] ignore switch vtep ip for non spine leaf
Browse files Browse the repository at this point in the history
  • Loading branch information
Frostman committed Dec 14, 2023
1 parent ed7eeb0 commit dd44f1a
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions api/wiring/v1alpha2/switch_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,8 @@ func (sw *Switch) Validate(ctx context.Context, client validation.Client, spineL
if sw.Spec.ProtocolIP == "" {
return nil, errors.Errorf("protocol IP is required")
}
if sw.Spec.Role.IsLeaf() {
if spineLeaf && sw.Spec.VTEPIP == "" {
return nil, errors.Errorf("VTEP IP is required for leaf switches in spine-leaf mode")
}
if !spineLeaf && sw.Spec.VTEPIP != "" {
return nil, errors.Errorf("VTEP IP is not allowed for leaf switches in non spine-leaf mode")
}
if sw.Spec.Role.IsLeaf() && spineLeaf && sw.Spec.VTEPIP == "" {
return nil, errors.Errorf("VTEP IP is required for leaf switches in spine-leaf mode")
}
if sw.Spec.Role.IsSpine() && sw.Spec.VTEPIP != "" {
return nil, errors.Errorf("VTEP IP is not allowed for spine switches")
Expand Down

0 comments on commit dd44f1a

Please sign in to comment.