Skip to content

Commit

Permalink
Remove remaining temp file after Artifactory download (jfrog#1036)
Browse files Browse the repository at this point in the history
  • Loading branch information
eyalbe4 authored Nov 3, 2024
1 parent ba61c56 commit 63e06cd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
9 changes: 5 additions & 4 deletions artifactory/services/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ package services
import (
"errors"
"fmt"
"github.com/jfrog/build-info-go/entities"
"github.com/jfrog/gofrog/crypto"
ioutils "github.com/jfrog/gofrog/io"
"github.com/jfrog/gofrog/version"
"net/http"
"os"
"path"
"path/filepath"
"sort"
"strings"

"github.com/jfrog/build-info-go/entities"
"github.com/jfrog/gofrog/crypto"
ioutils "github.com/jfrog/gofrog/io"
"github.com/jfrog/gofrog/version"

"github.com/jfrog/jfrog-client-go/http/httpclient"

"github.com/jfrog/gofrog/parallel"
Expand Down
10 changes: 5 additions & 5 deletions artifactory/services/utils/searchutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,25 +242,25 @@ func FilterResultsByBuild(specFile *CommonParams, flags CommonConf, requiredArti
// AND
// 2. Properties weren't fetched during 'build' filtering
// Otherwise, nil will be returned
func fetchProps(specFile *CommonParams, flags CommonConf, requiredArtifactProps RequiredArtifactProps, reader *content.ContentReader) (*content.ContentReader, error) {
func fetchProps(specFile *CommonParams, flags CommonConf, requiredArtifactProps RequiredArtifactProps, reader *content.ContentReader) (r *content.ContentReader, err error) {
if !includePropertiesInAqlForSpec(specFile) && specFile.Build == "" && requiredArtifactProps != NONE {
var readerWithProps *content.ContentReader
var err error
switch requiredArtifactProps {
case ALL:
readerWithProps, err = searchProps(specFile.Aql.ItemsFind, "*", []string{"*"}, flags)
case SYMLINK:
readerWithProps, err = searchProps(specFile.Aql.ItemsFind, "symlink.dest", []string{"*"}, flags)
}
if err != nil {
return nil, err
return
}
defer func() {
err = errors.Join(err, errorutils.CheckError(reader.Close()))
err = errors.Join(err, errorutils.CheckError(readerWithProps.Close()))
}()
return loadMissingProperties(reader, readerWithProps)
r, err = loadMissingProperties(reader, readerWithProps)
}
return nil, nil
return
}

func aqlSearch(aqlQuery string, flags CommonConf) (*content.ContentReader, error) {
Expand Down
4 changes: 3 additions & 1 deletion http/httpclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ package httpclient
import (
"bytes"
"context"
"github.com/minio/sha256-simd"
"strings"

"github.com/minio/sha256-simd"

//#nosec G505 -- sha1 is supported by Artifactory.
"crypto/sha1"
"encoding/hex"
Expand Down

0 comments on commit 63e06cd

Please sign in to comment.