Skip to content

Commit d432f18

Browse files
committed
Make on-ready inspect strict again
Signed-off-by: Sergei Lukianov <me@slukjanov.name>
1 parent 325c574 commit d432f18

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

pkg/hhfab/testing.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,6 +1509,7 @@ func CollectN[E any](n int, seq iter.Seq[E]) []E {
15091509

15101510
type InspectOpts struct {
15111511
WaitAppliedFor time.Duration
1512+
Strict bool
15121513
}
15131514

15141515
func (c *Config) Inspect(ctx context.Context, vlab *VLAB, opts InspectOpts) error {
@@ -1544,7 +1545,7 @@ func (c *Config) Inspect(ctx context.Context, vlab *VLAB, opts InspectOpts) erro
15441545
Verbose: true,
15451546
Output: inspect.OutputTypeText,
15461547
}, inspect.LLDPIn{
1547-
Strict: false, // TODO make it strict
1548+
Strict: opts.Strict,
15481549
Fabric: true,
15491550
External: true,
15501551
Server: true,
@@ -1557,7 +1558,7 @@ func (c *Config) Inspect(ctx context.Context, vlab *VLAB, opts InspectOpts) erro
15571558
Verbose: true,
15581559
Output: inspect.OutputTypeText,
15591560
}, inspect.BGPIn{
1560-
Strict: false, // TODO make it strict
1561+
Strict: opts.Strict,
15611562
}, os.Stdout); err != nil {
15621563
slog.Error("Failed to inspect BGP", "err", err)
15631564
fail = true

pkg/hhfab/vlabrunner.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -541,12 +541,10 @@ func (c *Config) VLABRun(ctx context.Context, vlab *VLAB, opts VLABRunOpts) erro
541541
return fmt.Errorf("waiting: %w", err)
542542
}
543543
case OnReadyInspect:
544-
appliedFor := 2 * time.Minute
545-
if opts.ControlUpgrade {
546-
appliedFor = 4 * time.Minute
547-
}
548-
549-
if err := c.Inspect(ctx, vlab, InspectOpts{WaitAppliedFor: appliedFor}); err != nil {
544+
if err := c.Inspect(ctx, vlab, InspectOpts{
545+
WaitAppliedFor: 2 * time.Minute,
546+
Strict: !opts.ControlUpgrade,
547+
}); err != nil {
550548
slog.Warn("Failed to inspect", "err", err)
551549

552550
if opts.CollectShowTech {

0 commit comments

Comments
 (0)