Skip to content

Commit

Permalink
Add JF_MSI env var (#883)
Browse files Browse the repository at this point in the history
  • Loading branch information
orz25 authored Jan 22, 2024
1 parent ff9d6fb commit cd958f6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions xray/services/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/jfrog/jfrog-client-go/utils/log"
xrayUtils "github.com/jfrog/jfrog-client-go/xray/services/utils"
"net/http"
"os"
"strings"
"time"

Expand Down Expand Up @@ -45,8 +46,6 @@ const (

XscGraphAPI = "api/v1/sca/scan/graph"

multiScanIdParam = "multi_scan_id="

scanTechQueryParam = "tech="

XscVersionAPI = "api/v1/system/version"
Expand Down Expand Up @@ -84,7 +83,6 @@ func createScanGraphQueryParams(scanParams XrayGraphScanParams) string {
}

if scanParams.XscVersion != "" {
params = append(params, multiScanIdParam+scanParams.MultiScanId)
gitInfoContext := scanParams.XscGitInfoContext
if gitInfoContext != nil {
if len(gitInfoContext.Technologies) > 0 {
Expand All @@ -110,7 +108,9 @@ func (ss *ScanService) ScanGraph(scanParams XrayGraphScanParams) (string, error)
if err != nil {
return "", fmt.Errorf("failed sending Git Info to XSC service, error: %s ", err.Error())
}
scanParams.MultiScanId = multiScanId
if err = os.Setenv("JF_MSI", multiScanId); err != nil {
log.Debug(errorutils.CheckErrorf("failed setting MSI as environment variable. Cause: %s", err.Error()))
}
}

httpClientsDetails := ss.XrayDetails.CreateHttpClientDetails()
Expand Down Expand Up @@ -280,7 +280,6 @@ type XrayGraphScanParams struct {
IncludeLicenses bool
XscGitInfoContext *XscGitInfoContext
XscVersion string
MultiScanId string
}

type RequestScanResponse struct {
Expand Down

0 comments on commit cd958f6

Please sign in to comment.