Skip to content

Commit

Permalink
merge up-to-date commits
Browse files Browse the repository at this point in the history
  • Loading branch information
cho4036 committed Feb 21, 2024
1 parent 435d4e6 commit 00db874
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
10 changes: 5 additions & 5 deletions internal/delivery/http/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ func (p ProjectHandler) AddProjectMember(w http.ResponseWriter, r *http.Request)
ErrorJSON(w, r, httpErrors.NewInternalServerError(err, "", ""))
return
}
var stackIds map[string]struct{}
stackIds := make(map[string]struct{})
for _, pn := range pns {
stackIds[pn.StackId] = struct{}{}
}
Expand Down Expand Up @@ -791,7 +791,7 @@ func (p ProjectHandler) RemoveProjectMember(w http.ResponseWriter, r *http.Reque
ErrorJSON(w, r, httpErrors.NewInternalServerError(err, "", ""))
return
}
var stackIds map[string]struct{}
stackIds := make(map[string]struct{})
for _, pn := range pns {
stackIds[pn.StackId] = struct{}{}
}
Expand Down Expand Up @@ -854,7 +854,7 @@ func (p ProjectHandler) RemoveProjectMembers(w http.ResponseWriter, r *http.Requ
ErrorJSON(w, r, httpErrors.NewInternalServerError(err, "", ""))
return
}
var stackIds map[string]struct{}
stackIds := make(map[string]struct{})
for _, pn := range pns {
stackIds[pn.StackId] = struct{}{}
}
Expand Down Expand Up @@ -941,7 +941,7 @@ func (p ProjectHandler) UpdateProjectMemberRole(w http.ResponseWriter, r *http.R
ErrorJSON(w, r, httpErrors.NewInternalServerError(err, "", ""))
return
}
var stackIds map[string]struct{}
stackIds := make(map[string]struct{})
for _, pn := range pns {
stackIds[pn.StackId] = struct{}{}
}
Expand Down Expand Up @@ -1018,7 +1018,7 @@ func (p ProjectHandler) UpdateProjectMembersRole(w http.ResponseWriter, r *http.
ErrorJSON(w, r, httpErrors.NewInternalServerError(err, "", ""))
return
}
var stackIds map[string]struct{}
stackIds := make(map[string]struct{})
for _, pn := range pns {
stackIds[pn.StackId] = struct{}{}
}
Expand Down
6 changes: 2 additions & 4 deletions internal/usecase/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package usecase

import (
"github.com/google/uuid"
"github.com/openinfradev/tks-api/internal/kubernetes"
"github.com/openinfradev/tks-api/internal/keycloak"
"github.com/openinfradev/tks-api/internal/kubernetes"
"github.com/openinfradev/tks-api/internal/repository"
Expand Down Expand Up @@ -50,7 +49,6 @@ type IProjectUsecase interface {
CreateK8SNSRoleBinding(organizationId string, projectId string, stackId string, namespace string) error
DeleteK8SNSRoleBinding(organizationId string, projectId string, stackId string, namespace string) error
GetProjectKubeconfig(organizationId string, projectId string) (string, error)
}

AssignKeycloakClientRoleToMember(organizationId string, projectId string, stackId string, projectMemberId string) error
UnassignKeycloakClientRoleToMember(organizationId string, projectId string, stackId string, projectMemberId string) error
Expand Down Expand Up @@ -346,7 +344,7 @@ func (u *ProjectUsecase) EnsureRequiredSetupForCluster(organizationId string, pr
return errors.Wrap(err, "Failed to create project namespace.")
}

projectMembers, err := u.GetProjectMembersByProjectId(projectId)
projectMembers, err := u.GetProjectMembers(projectId, ProjectAll)
if err != nil {
log.Error(err)
return errors.Wrap(err, "Failed to create project namespace.")
Expand Down Expand Up @@ -384,7 +382,7 @@ func (u *ProjectUsecase) MayRemoveRequiredSetupForCluster(organizationId string,
return errors.Wrap(err, "Failed to create project namespace.")
}

projectMembers, err := u.GetProjectMembersByProjectId(projectId)
projectMembers, err := u.GetProjectMembers(projectId, ProjectAll)
if err != nil {
log.Error(err)
return errors.Wrap(err, "Failed to create project namespace.")
Expand Down

0 comments on commit 00db874

Please sign in to comment.