Skip to content

cmd/flow: validate nodes-count before generation - #292

Open
immanuwell wants to merge 1 commit into
cilium:mainfrom
immanuwell:fix-flow-nodes-count-validation
Open

cmd/flow: validate nodes-count before generation#292
immanuwell wants to merge 1 commit into
cilium:mainfrom
immanuwell:fix-flow-nodes-count-validation

Conversation

@immanuwell

Copy link
Copy Markdown

fake flow blows up on --nodes-count 0 with a panic.

This validates --nodes-count before generation, and adds a test. Small fix, but it saves a kinda dumb crash.

Repro:

  1. cd cmd
  2. go run . flow --nodes-count 0

Before:
panic: invalid argument to IntN

After:
--nodes-count must be at least 1

@kaworu kaworu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@kaworu kaworu added bug Something isn't working module/flow Affects the flow module labels Jul 27, 2026
@kaworu

kaworu commented Aug 18, 2026

Copy link
Copy Markdown
Member

@immanuwell can you please fix or add an ignore tag to the golangci issue please

  Error: /home/runner/work/fake/fake/cmd/internal/cmd/flow/flow_test.go:29:22: string `10.0.0.0/8` has 4 occurrences, make it a constant (goconst)
  			opts.sourceCIDR = "10.0.0.0/8"
  			                  ^
  1 issues:
  * goconst: 1

@kaworu kaworu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

goconst

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working module/flow Affects the flow module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants