Skip to content

Commit

Permalink
fix pipeline cancel missing user when req userid is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
chengjoey committed Mar 20, 2024
1 parent bc931b3 commit 56fe54f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/tools/pipeline/providers/pipeline/cancel.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,18 @@ import (
"github.com/erda-project/erda-proto-go/core/pipeline/pipeline/pb"
"github.com/erda-project/erda/internal/tools/pipeline/services/apierrors"
"github.com/erda-project/erda/internal/tools/pipeline/spec"
"github.com/erda-project/erda/pkg/common/apis"
)

func (s *pipelineService) PipelineCancel(ctx context.Context, req *pb.PipelineCancelRequest) (*pb.PipelineCancelResponse, error) {
p, err := s.Get(req.PipelineID)
if err != nil {
return nil, apierrors.ErrCancelPipeline.NotFound()
}
identityInfo := apis.GetIdentityInfo(ctx)
if len(req.UserID) == 0 && identityInfo != nil {
req.UserID = identityInfo.UserID
}
if s.edgeRegister.IsCenter() && p.IsEdge {
s.p.Log.Infof("proxy cancel pipeline to edge, pipelineID: %d", p.ID)
if err := s.proxyCancelPipelineRequestToEdge(ctx, p, req); err != nil {
Expand Down

0 comments on commit 56fe54f

Please sign in to comment.