Skip to content

Commit

Permalink
feature. rollback to tks-admin
Browse files Browse the repository at this point in the history
  • Loading branch information
ktkfree committed Nov 3, 2023
1 parent 1e5d1db commit 20763aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions internal/helper/id.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
)

var (
TKS_ADMIN = "tks-admin"
PREFIX_USER_ID = "u"
PREFIX_CLUSTER_ID = "c"
PREFIX_ORGANIZATION_ID = "o"
Expand All @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions internal/usecase/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 20763aa

Please sign in to comment.