From 3a9553950f74670ffcee351774ab2c0d4ce321ba Mon Sep 17 00:00:00 2001 From: Rahul Mehta <98349643+rahul-theorem@users.noreply.github.com> Date: Tue, 30 Aug 2022 08:13:25 -0400 Subject: [PATCH 1/2] Increase `allowedExecutionNameLength` to 63 Signed-off-by: Rahul Mehta <98349643+rahul-theorem@users.noreply.github.com> --- pkg/manager/impl/validation/execution_validator.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/manager/impl/validation/execution_validator.go b/pkg/manager/impl/validation/execution_validator.go index fc4f99393..8db798eb0 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]*$`) From 658611f37c6705fb0897500033e2decf74584ebe Mon Sep 17 00:00:00 2001 From: Rahul Mehta Date: Tue, 30 Aug 2022 22:40:42 -0400 Subject: [PATCH 2/2] Update TestValidExecutionIdInvalidLength Signed-off-by: Rahul Mehta --- pkg/manager/impl/validation/execution_validator_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/manager/impl/validation/execution_validator_test.go b/pkg/manager/impl/validation/execution_validator_test.go index 7e5a2d4e9..0af0ebfde 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) {