diff --git a/CHANGELOG.md b/CHANGELOG.md index b2b9ff12c..df2af7184 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ - (Feature) Add DebugPackage to the OPS Binary - (Feature) (Networking) ArangoRoute Protocol - (Feature) (Platform) Platform Requirements support +- (Improvement) Drop slash requirement from ArangoRoute ## [1.2.43](https://github.com/arangodb/kube-arangodb/tree/1.2.43) (2024-10-14) - (Feature) ArangoRoute CRD diff --git a/pkg/apis/shared/validate.go b/pkg/apis/shared/validate.go index ceaffcc8c..6063b251a 100644 --- a/pkg/apis/shared/validate.go +++ b/pkg/apis/shared/validate.go @@ -36,7 +36,7 @@ import ( var ( resourceNameRE = regexp.MustCompile(`^([0-9\-\.a-z])+$`) - apiPathRE = regexp.MustCompile(`^/([_A-Za-z0-9\-]+/)*$`) + apiPathRE = regexp.MustCompile(`^(/[_A-Za-z0-9\-]+)*/?$`) ) const ( diff --git a/pkg/apis/shared/validate_test.go b/pkg/apis/shared/validate_test.go index 4a0dc4e93..263e7032b 100644 --- a/pkg/apis/shared/validate_test.go +++ b/pkg/apis/shared/validate_test.go @@ -36,7 +36,7 @@ func Test_ValidateAPIPath(t *testing.T) { require.NoError(t, ValidateAPIPath("")) require.NoError(t, ValidateAPIPath("/")) require.Error(t, ValidateAPIPath("//")) - require.Error(t, ValidateAPIPath("/api/zz")) + require.NoError(t, ValidateAPIPath("/api/zz")) require.NoError(t, ValidateAPIPath("/api/")) require.NoError(t, ValidateAPIPath("/api/test/qw/")) require.NoError(t, ValidateAPIPath("/api/test/2/"))