Skip to content

Commit f6c66a3

Browse files
committed
chore: correct log output of vlab gen
if no [mclag/eslag] leaves are present, the corresponding servers will not be generated, but the log output was still mentioning the default values, which can be confusing. Signed-off-by: Emanuele Di Pascale <[email protected]>
1 parent 209fd3d commit f6c66a3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pkg/hhfab/vlabbuilder.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,14 @@ func (b *VLABBuilder) Build(ctx context.Context, l *apiutil.Loader, fabricMode m
147147
eslagLeafGroups = append(eslagLeafGroups, uint8(leafs))
148148
}
149149
}
150+
// this has no effect but the log output can be confusing, so if there
151+
// is no **LAG leaf set the corresponding **LAG servers to 0
152+
if totalESLAGLeafs == 0 {
153+
b.ESLAGServers = 0
154+
}
155+
if b.MCLAGLeafsCount == 0 {
156+
b.MCLAGServers = 0
157+
}
150158

151159
if b.MCLAGLeafsCount%2 != 0 {
152160
return fmt.Errorf("MCLAG leafs count must be even") //nolint:goerr113

0 commit comments

Comments
 (0)