From 20763aaac52edf589c446aa2ce348c2396950ef5 Mon Sep 17 00:00:00 2001 From: "taekyu.kang" Date: Fri, 3 Nov 2023 14:39:48 +0900 Subject: [PATCH] feature. rollback to tks-admin --- internal/helper/id.go | 4 ++++ internal/usecase/cluster.go | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/helper/id.go b/internal/helper/id.go index 3e8225e1..a194a158 100644 --- a/internal/helper/id.go +++ b/internal/helper/id.go @@ -7,6 +7,7 @@ import ( ) var ( + TKS_ADMIN = "tks-admin" PREFIX_USER_ID = "u" PREFIX_CLUSTER_ID = "c" PREFIX_ORGANIZATION_ID = "o" @@ -29,6 +30,9 @@ func GenerateApplicaionGroupId() string { } func ValidateClusterId(id string) bool { + if id == TKS_ADMIN { + return true + } if !strings.HasPrefix(id, PREFIX_CLUSTER_ID) { return false } diff --git a/internal/usecase/cluster.go b/internal/usecase/cluster.go index 16df8b46..cf339797 100644 --- a/internal/usecase/cluster.go +++ b/internal/usecase/cluster.go @@ -238,8 +238,8 @@ func (u *ClusterUsecase) Import(ctx context.Context, dto domain.Cluster) (cluste userId := user.GetUserId() dto.CreatorId = &userId if dto.ClusterType == domain.ClusterType_ADMIN { - dto.ID = "ctksadmin" - dto.Name = "ctksadmin" + dto.ID = "tks-admin" + dto.Name = "tks-admin" } clusterId, err = u.repo.Create(dto) if err != nil {