Skip to content

Commit

Permalink
Merge pull request #114 from xuzhu-591/fix-miss-build-log
Browse files Browse the repository at this point in the history
fix: add some logs for troubleshooting of missing buildLog
  • Loading branch information
xuzhu-591 authored Apr 25, 2023
2 parents e9d9f78 + 2fae98f commit 518de1c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/controller/cloudevent/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ func (c *controller) CloudEvent(ctx context.Context, wpr *WrappedPipelineRun) (e
if err != nil {
return err
}
log.Debugf(ctx, "got cloudEvent of pipelineRun %v, event id: %v",
horizonMetaData.PipelinerunID, horizonMetaData.EventID)

environment := horizonMetaData.Environment
pipelinerunID := horizonMetaData.PipelinerunID
Expand All @@ -94,6 +96,9 @@ func (c *controller) CloudEvent(ctx context.Context, wpr *WrappedPipelineRun) (e
return err
}

log.Debugf(ctx, "pipelineRun %v status: %v, started at %v, finished at %v",
pipelinerunID, result.Result, result.StartTime, result.CompletionTime)

// 2. update pipelinerun in db
if err := c.pipelinerunMgr.UpdateResultByID(ctx, pipelinerunID, &prmodels.Result{
S3Bucket: result.Bucket,
Expand Down
9 changes: 9 additions & 0 deletions pkg/cluster/tekton/collector/collector_s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,17 @@ func (c *S3Collector) Collect(ctx context.Context, pr *v1beta1.PipelineRun, hori
if err != nil {
return nil, err
}

logutil.Debugf(ctx, "collected log result: logObject: %s, logURL: %s",
collectLogResult.LogObject, collectLogResult.LogURL)

collectObjectResult, err := c.collectObject(ctx, metadata, pr)
if err != nil {
return nil, err
}

logutil.Debugf(ctx, "collected object result: %+v", collectObjectResult)

logStruct := NewLogStruct(collectObjectResult.PrURL,
metadata, collectLogResult.LogURL, collectLogResult.LogContent)
b, err := json.Marshal(logStruct)
Expand Down Expand Up @@ -172,6 +178,9 @@ func (c *S3Collector) Collect(ctx context.Context, pr *v1beta1.PipelineRun, hori
}
return nil, err
}

logutil.Debugf(ctx, "tekton pipelineRun is deleted successfully, ID: %v", horizonMetaData.PipelinerunID)

return collectResult, nil
}

Expand Down

0 comments on commit 518de1c

Please sign in to comment.