From b962ed7abe77fb0dfdbb81b03e594ac39b0cd57a Mon Sep 17 00:00:00 2001 From: Rahul Mehta <98349643+rahul-theorem@users.noreply.github.com> Date: Wed, 31 Aug 2022 16:07:55 -0400 Subject: [PATCH] Increase `allowedExecutionNameLength` to 63 (#466) * Increase `allowedExecutionNameLength` to 63 Signed-off-by: Rahul Mehta <98349643+rahul-theorem@users.noreply.github.com> * Update TestValidExecutionIdInvalidLength Signed-off-by: Rahul Mehta Signed-off-by: Rahul Mehta <98349643+rahul-theorem@users.noreply.github.com> Signed-off-by: Rahul Mehta --- pkg/manager/impl/validation/execution_validator.go | 3 ++- pkg/manager/impl/validation/execution_validator_test.go | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/manager/impl/validation/execution_validator.go b/pkg/manager/impl/validation/execution_validator.go index fc4f993930..8db798eb0c 100644 --- a/pkg/manager/impl/validation/execution_validator.go +++ b/pkg/manager/impl/validation/execution_validator.go @@ -16,7 +16,8 @@ import ( "google.golang.org/grpc/codes" ) -const allowedExecutionNameLength = 20 +// Maximum value length of a Kubernetes label +const allowedExecutionNameLength = 63 var executionIDRegex = regexp.MustCompile(`^[a-z][a-z\-0-9]*$`) diff --git a/pkg/manager/impl/validation/execution_validator_test.go b/pkg/manager/impl/validation/execution_validator_test.go index 7e5a2d4e9d..0af0ebfde0 100644 --- a/pkg/manager/impl/validation/execution_validator_test.go +++ b/pkg/manager/impl/validation/execution_validator_test.go @@ -162,9 +162,9 @@ func TestValidExecutionId(t *testing.T) { } func TestValidExecutionIdInvalidLength(t *testing.T) { - err := CheckValidExecutionID("abcdeasdasdasdasdasdasdasd123", "a") + err := CheckValidExecutionID("abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabc", "a") assert.NotNil(t, err) - assert.EqualError(t, err, "size of a exceeded length 20 : abcdeasdasdasdasdasdasdasd123") + assert.EqualError(t, err, "size of a exceeded length 63 : abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabc") } func TestValidExecutionIdInvalidChars(t *testing.T) {