Skip to content

Commit

Permalink
restrict user create piplines in system namespaces (#238)
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim Paskal <paskal.maksim@gmail.com>
  • Loading branch information
maksim-paskal authored Sep 10, 2024
1 parent 095567d commit f6eb137
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/api/createGitlabPipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ func (e *Environment) CreateGitlabPipeline(ctx context.Context, input *CreateGit
return "", errNoGitlabClient
}

if e.IsSystemNamespace() {
return "", errors.New("can not create pipeline in system namespace")
}

projectIDInt, err := strconv.Atoi(input.ProjectID)
if err != nil {
return "", errors.Wrap(err, "can not convert to number")
Expand Down

0 comments on commit f6eb137

Please sign in to comment.