Skip to content

Introduce dutagent config validation#227

Open
sylv-io wants to merge 1 commit into
mainfrom
config_validation
Open

Introduce dutagent config validation#227
sylv-io wants to merge 1 commit into
mainfrom
config_validation

Conversation

@sylv-io

@sylv-io sylv-io commented Oct 23, 2025

Copy link
Copy Markdown
Contributor

Add configuration validation to detect device names that conflict with dutagent subcommands.

Addresses #84

@sylv-io sylv-io force-pushed the config_validation branch 4 times, most recently from 99462b7 to acd17b0 Compare October 23, 2025 13:05
@sylv-io

sylv-io commented Oct 23, 2025

Copy link
Copy Markdown
Contributor Author

fyi: Lint error is unrelated to my code. i did not modify cmds/exp/dutserver/rpc.go.

@sylv-io

sylv-io commented Oct 23, 2025

Copy link
Copy Markdown
Contributor Author

Do not Merge. we should do the validation using custom UnmarshalYAML instead. (analog to the device and command validation)

@jenstopp

Copy link
Copy Markdown
Member

And we should keep the lists of reserved words as exported var/const in a respective place/package so that is shows up at go doc.

@sylv-io

sylv-io commented Oct 23, 2025

Copy link
Copy Markdown
Contributor Author

I moved the validation into the UnmarshalYAML method 👍

And we should keep the lists of reserved words as exported var/const in a respective place/package so that is shows up at go doc.

I tried, but i cannot define []string as const and also the Linter argues because global vars are not allowed. Not sure how to fullfill this request 😅. Any recommendation?

Add configuration validation to detect device names that conflict with
dutagent subcommands.

Signed-off-by: Marcello Sylvester Bauer <marcello.bauer@9elements.com>
@RiSKeD

RiSKeD commented Nov 13, 2025

Copy link
Copy Markdown
Contributor

i think you can add a local var string[] to the pkg and expose it via a function. I am not sure what else can be done expect disable the linter on that line.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants