Skip to content

Commit

Permalink
resolve comments
Browse files Browse the repository at this point in the history
Signed-off-by: wang yan <[email protected]>
  • Loading branch information
wy65701436 committed Nov 25, 2024
1 parent 6c6d961 commit 99c44ba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/controller/scan/callback.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"context"
"encoding/json"

"github.com/goharbor/harbor/src/common/secret"
"github.com/goharbor/harbor/src/controller/artifact"
"github.com/goharbor/harbor/src/controller/event/metadata"
"github.com/goharbor/harbor/src/controller/event/operator"
Expand Down Expand Up @@ -92,7 +93,7 @@ func scanTaskStatusChange(ctx context.Context, taskID int64, status string) (err

robotID := getRobotID(t.ExtraAttrs)
if robotID > 0 {
if err := robotCtl.Delete(ctx, robotID, &robot.Option{Operator: "job-service"}); err != nil {
if err := robotCtl.Delete(ctx, robotID, &robot.Option{Operator: secret.JobserviceUser}); err != nil {
// Should not block the main flow, just logged
logger.WithFields(log.Fields{"robot_id": robotID, "error": err}).Error("delete robot account failed")
} else {
Expand Down

0 comments on commit 99c44ba

Please sign in to comment.