From 5ab2b82e473ff6fa0c5b06deb0e4e9b53bc064aa Mon Sep 17 00:00:00 2001 From: Raj Aryan Date: Tue, 26 Dec 2023 17:46:15 +0530 Subject: [PATCH] Feature: add name-length of dummy interface too long error --- cmd/yurthub/app/options/options.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/yurthub/app/options/options.go b/cmd/yurthub/app/options/options.go index cc8c46dde0a..311c23e4255 100644 --- a/cmd/yurthub/app/options/options.go +++ b/cmd/yurthub/app/options/options.go @@ -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) + } + 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") }