Skip to content

Commit

Permalink
rename func
Browse files Browse the repository at this point in the history
Signed-off-by: Amir Malka <amirm@armosec.io>
  • Loading branch information
amirmalka committed Oct 3, 2023
1 parent 5f4d126 commit 7245b73
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions adapters/v1/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (a *BackendAdapter) GetCVEExceptions(ctx context.Context) (domain.CVEExcept
},
}

vulnExceptionList, err := a.getCVEExceptionsFunc(a.apiServerRestURL, a.clusterConfig.AccountID, &designator, a.setPostResultHeaders())
vulnExceptionList, err := a.getCVEExceptionsFunc(a.apiServerRestURL, a.clusterConfig.AccountID, &designator, a.getRequestHeaders())
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -124,7 +124,7 @@ func (a *BackendAdapter) SendStatus(ctx context.Context, step int) error {
report.ParentAction = workload.ParentJobID
report.Details = details[step]

sender := backendClientV1.NewBaseReportSender(a.eventReceiverRestURL, &http.Client{}, a.setPostResultHeaders(), report)
sender := backendClientV1.NewBaseReportSender(a.eventReceiverRestURL, &http.Client{}, a.getRequestHeaders(), report)
a.sendStatusFunc(sender, sysreport.JobSuccess, true)
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions adapters/v1/backend_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (a *BackendAdapter) postResultsAsGoroutine(ctx context.Context, report *v1.
}(report, eventReceiverURL, imagetag, wlid, errorChan, wg)
}

func (a *BackendAdapter) setPostResultHeaders() map[string]string {
func (a *BackendAdapter) getRequestHeaders() map[string]string {
return map[string]string{
"Content-Type": "application/json",
"Authorization": "Bearer " + a.accessToken,
Expand All @@ -86,7 +86,7 @@ func (a *BackendAdapter) postResults(ctx context.Context, report *v1.ScanResultR
return
}

resp, err := a.httpPostFunc(http.DefaultClient, urlBase.String(), a.setPostResultHeaders(), payload)
resp, err := a.httpPostFunc(http.DefaultClient, urlBase.String(), a.getRequestHeaders(), payload)
if err != nil {
logger.L().Ctx(ctx).Error("failed posting to event", helpers.Error(err),
helpers.String("image", imagetag),
Expand Down

0 comments on commit 7245b73

Please sign in to comment.