You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by do...@apache.org on 2022/09/23 03:46:52 UTC

[inlong] branch master updated: [INLONG-5998][Manager] Only lower case allowed for source name (#5999)

This is an automated email from the ASF dual-hosted git repository.

dockerzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong.git


The following commit(s) were added to refs/heads/master by this push:
     new 696d73462 [INLONG-5998][Manager] Only lower case allowed for source name (#5999)
696d73462 is described below

commit 696d73462706f0ff6f857bca50c5745ba9adc841
Author: woofyzhao <49...@qq.com>
AuthorDate: Fri Sep 23 11:46:45 2022 +0800

    [INLONG-5998][Manager] Only lower case allowed for source name (#5999)
---
 .../org/apache/inlong/manager/service/core/impl/AgentServiceImpl.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/AgentServiceImpl.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/AgentServiceImpl.java
index 111035c87..d091bdf7e 100644
--- a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/AgentServiceImpl.java
+++ b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/AgentServiceImpl.java
@@ -55,6 +55,7 @@ import org.springframework.transaction.annotation.Transactional;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
+import java.util.Locale;
 import java.util.Objects;
 import java.util.stream.Collectors;
 
@@ -264,7 +265,8 @@ public class AgentServiceImpl implements AgentService {
             fileEntity.setExtParams(sourceEntity.getExtParams());
             fileEntity.setAgentIp(agentIp);
             fileEntity.setUuid(uuid);
-            fileEntity.setSourceName(fileEntity.getSourceName() + "-" + RandomStringUtils.randomAlphanumeric(10));
+            fileEntity.setSourceName(fileEntity.getSourceName() + "-"
+                    + RandomStringUtils.randomAlphanumeric(10).toLowerCase(Locale.ROOT));
             fileEntity.setTemplateId(sourceEntity.getId());
             int nextStatus = getNextStatus(fileEntity.getStatus());
             fileEntity.setStatus(nextStatus);