From a53a13e32d40c1997590f4f6e81708ddaf050cb4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 20 Feb 2024 19:32:56 +0800 Subject: [PATCH] Feature: add name-length of dummy interface too long error (#1952) (cherry picked from commit 5ab2b82e473ff6fa0c5b06deb0e4e9b53bc064aa) Co-authored-by: Raj Aryan --- 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") }