Skip to content

Commit

Permalink
Feature: add name-length of dummy interface too long error
Browse files Browse the repository at this point in the history
  • Loading branch information
8rxn committed Dec 26, 2023
1 parent 74b0a47 commit 5ab2b82
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/yurthub/app/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ func (options *YurtHubOptions) Validate() error {
return fmt.Errorf("dummy ip %s is not invalid, %w", options.HubAgentDummyIfIP, err)
}

if len(options.HubAgentDummyIfName) > 15 {
return fmt.Errorf("dummy name %s length should not be more than 15", options.HubAgentDummyIfName)
}

Check warning on line 172 in cmd/yurthub/app/options/options.go

View check run for this annotation

Codecov / codecov/patch

cmd/yurthub/app/options/options.go#L171-L172

Added lines #L171 - L172 were not covered by tests

if len(options.CACertHashes) == 0 && !options.UnsafeSkipCAVerification {
return fmt.Errorf("set --discovery-token-unsafe-skip-ca-verification flag as true or pass CACertHashes to continue")
}
Expand Down

0 comments on commit 5ab2b82

Please sign in to comment.