diff --git a/artifactory/commands/generic/download.go b/artifactory/commands/generic/download.go index cef98e8ee..3dbf87732 100644 --- a/artifactory/commands/generic/download.go +++ b/artifactory/commands/generic/download.go @@ -209,7 +209,7 @@ func getDownloadParams(f *spec.File, configuration *utils.DownloadConfiguration) return } downParams.Symlink = configuration.Symlink - downParams.MinSplitSizeKb = configuration.MinSplitSizeKb + downParams.MinSplitSize = configuration.MinSplitSize downParams.SplitCount = configuration.SplitCount downParams.SkipChecksum = configuration.SkipChecksum diff --git a/artifactory/utils/container/buildinfo.go b/artifactory/utils/container/buildinfo.go index 412f2f4ab..9afc98063 100644 --- a/artifactory/utils/container/buildinfo.go +++ b/artifactory/utils/container/buildinfo.go @@ -124,17 +124,33 @@ func writeLayersToFile(layers []utils.ResultItem) (filePath string, err error) { // Return - manifest artifacts as buildinfo.Artifact struct. func getManifestArtifact(manifest *utils.ResultItem) (artifact buildinfo.Artifact) { - return buildinfo.Artifact{Name: "manifest.json", Type: "json", Checksum: buildinfo.Checksum{Sha1: manifest.Actual_Sha1, Md5: manifest.Actual_Md5}, Path: path.Join(manifest.Path, manifest.Name)} + return buildinfo.Artifact{ + Name: "manifest.json", + Type: "json", + Checksum: buildinfo.Checksum{Sha1: manifest.Actual_Sha1, Md5: manifest.Actual_Md5}, + Path: path.Join(manifest.Path, manifest.Name), + OriginalDeploymentRepo: manifest.Repo, + } } // Return - fat manifest artifacts as buildinfo.Artifact struct. func getFatManifestArtifact(fatManifest *utils.ResultItem) (artifact buildinfo.Artifact) { - return buildinfo.Artifact{Name: "list.manifest.json", Type: "json", Checksum: buildinfo.Checksum{Sha1: fatManifest.Actual_Sha1, Md5: fatManifest.Actual_Md5}, Path: path.Join(fatManifest.Path, fatManifest.Name)} + return buildinfo.Artifact{ + Name: "list.manifest.json", + Type: "json", + Checksum: buildinfo.Checksum{Sha1: fatManifest.Actual_Sha1, Md5: fatManifest.Actual_Md5}, + Path: path.Join(fatManifest.Path, fatManifest.Name), + OriginalDeploymentRepo: fatManifest.Repo, + } } // Return - manifest dependency as buildinfo.Dependency struct. func getManifestDependency(searchResults *utils.ResultItem) (dependency buildinfo.Dependency) { - return buildinfo.Dependency{Id: "manifest.json", Type: "json", Checksum: buildinfo.Checksum{Sha1: searchResults.Actual_Sha1, Md5: searchResults.Actual_Md5}} + return buildinfo.Dependency{ + Id: "manifest.json", + Type: "json", + Checksum: buildinfo.Checksum{Sha1: searchResults.Actual_Sha1, Md5: searchResults.Actual_Md5}, + } } // Read the file which contains the following format: 'IMAGE-TAG-IN-ARTIFACTORY'@sha256'SHA256-OF-THE-IMAGE-MANIFEST'. @@ -321,7 +337,7 @@ func (builder *buildInfoBuilder) createBuildInfo(commandType CommandType, manife } // Create the image's build info from list.manifest.json. -func (builder *buildInfoBuilder) createMultiPlatformBuildInfo(fatManifest *FatManifest, searchRultFatManifest *utils.ResultItem, candidateimages map[string][]*utils.ResultItem, module string) (*buildinfo.BuildInfo, error) { +func (builder *buildInfoBuilder) createMultiPlatformBuildInfo(fatManifest *FatManifest, searchResultFatManifest *utils.ResultItem, candidateImages map[string][]*utils.ResultItem, module string) (*buildinfo.BuildInfo, error) { imageProperties := map[string]string{ "docker.image.tag": builder.image.Name(), } @@ -333,17 +349,17 @@ func (builder *buildInfoBuilder) createMultiPlatformBuildInfo(fatManifest *FatMa module = imageName } // Add layers. - builder.imageLayers = append(builder.imageLayers, *searchRultFatManifest) + builder.imageLayers = append(builder.imageLayers, *searchResultFatManifest) // Create fat-manifest module buildInfo := &buildinfo.BuildInfo{Modules: []buildinfo.Module{{ Id: module, Type: buildinfo.Docker, Properties: imageProperties, - Artifacts: []buildinfo.Artifact{getFatManifestArtifact(searchRultFatManifest)}, + Artifacts: []buildinfo.Artifact{getFatManifestArtifact(searchResultFatManifest)}, }}} // Create all image arch modules for _, manifest := range fatManifest.Manifests { - image := candidateimages[manifest.Digest] + image := candidateImages[manifest.Digest] var artifacts []buildinfo.Artifact for _, layer := range image { builder.imageLayers = append(builder.imageLayers, *layer) diff --git a/artifactory/utils/download.go b/artifactory/utils/download.go index 73b47b180..f2979523a 100644 --- a/artifactory/utils/download.go +++ b/artifactory/utils/download.go @@ -11,9 +11,10 @@ func CreateDownloadServiceManager(artDetails *config.ServerDetails, threads, htt } type DownloadConfiguration struct { - Threads int - SplitCount int - MinSplitSizeKb int64 + Threads int + SplitCount int + // Min split size in Kilobytes + MinSplitSize int64 Symlink bool ValidateSymlink bool SkipChecksum bool diff --git a/go.mod b/go.mod index 0e69c9aca..b00c02b9b 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/gookit/color v1.5.4 github.com/jedib0t/go-pretty/v6 v6.5.9 github.com/jfrog/build-info-go v1.9.30 - github.com/jfrog/gofrog v1.7.4 + github.com/jfrog/gofrog v1.7.5 github.com/jfrog/jfrog-client-go v1.43.0 github.com/magiconair/properties v1.8.7 github.com/manifoldco/promptui v0.9.0 @@ -22,7 +22,7 @@ require ( github.com/stretchr/testify v1.9.0 github.com/urfave/cli v1.22.15 github.com/vbauerster/mpb/v8 v8.7.4 - golang.org/x/exp v0.0.0-20240707233637-46b078467d37 + golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 golang.org/x/mod v0.19.0 golang.org/x/sync v0.7.0 golang.org/x/term v0.22.0 @@ -96,8 +96,8 @@ require ( gopkg.in/warnings.v0 v0.1.2 // indirect ) -replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go v1.28.1-0.20240725183511-4d539d3a7a99 +replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go v1.28.1-0.20240729103741-f6c521eb9a40 -// replace github.com/jfrog/build-info-go => github.com/eyalbe4/build-info-go v1.8.9-0.20240723132035-980d2c84b738 +replace github.com/jfrog/build-info-go => github.com/jfrog/build-info-go v1.8.9-0.20240729055355-5b51bf71e756 // replace github.com/jfrog/gofrog => github.com/jfrog/gofrog v1.3.3-0.20231223133729-ef57bd08cedc diff --git a/go.sum b/go.sum index 2e2408243..de53dccaa 100644 --- a/go.sum +++ b/go.sum @@ -92,12 +92,12 @@ github.com/jedib0t/go-pretty/v6 v6.5.9 h1:ACteMBRrrmm1gMsXe9PSTOClQ63IXDUt03H5U+ github.com/jedib0t/go-pretty/v6 v6.5.9/go.mod h1:zbn98qrYlh95FIhwwsbIip0LYpwSG8SUOScs+v9/t0E= github.com/jfrog/archiver/v3 v3.6.1 h1:LOxnkw9pOn45DzCbZNFV6K0+6dCsQ0L8mR3ZcujO5eI= github.com/jfrog/archiver/v3 v3.6.1/go.mod h1:VgR+3WZS4N+i9FaDwLZbq+jeU4B4zctXL+gL4EMzfLw= -github.com/jfrog/build-info-go v1.9.30 h1:RmK3NuDGUoyCjCNJJBlHaCm4vWzO8BLjkuAkMzj6PGE= -github.com/jfrog/build-info-go v1.9.30/go.mod h1:fxSfpp+kQ8qln/0y7pgV3tg2exWe5OM1np5FF2LlSDg= -github.com/jfrog/gofrog v1.7.4 h1:on4AeWef5LJUhGCigSjTS4Ez3n9l8+NiZlXH6UYp05c= -github.com/jfrog/gofrog v1.7.4/go.mod h1:jyGiCgiqSSR7k86hcUSu67XVvmvkkgWTmPsH25wI298= -github.com/jfrog/jfrog-client-go v1.28.1-0.20240725183511-4d539d3a7a99 h1:jCfJV5FXOIclSGhRbrTNNFteF27CSb+etW246mewVAk= -github.com/jfrog/jfrog-client-go v1.28.1-0.20240725183511-4d539d3a7a99/go.mod h1:1RklAq1rNS3HmIsJ+BM3tEn9XHZuTAs37JtVUpefUk4= +github.com/jfrog/build-info-go v1.8.9-0.20240729055355-5b51bf71e756 h1:xyZEZDZvg/sLS5PH5b8zFnj6b2XBW4aYHXey0sv+F9I= +github.com/jfrog/build-info-go v1.8.9-0.20240729055355-5b51bf71e756/go.mod h1:fxSfpp+kQ8qln/0y7pgV3tg2exWe5OM1np5FF2LlSDg= +github.com/jfrog/gofrog v1.7.5 h1:dFgtEDefJdlq9cqTRoe09RLxS5Bxbe1Ev5+E6SmZHcg= +github.com/jfrog/gofrog v1.7.5/go.mod h1:jyGiCgiqSSR7k86hcUSu67XVvmvkkgWTmPsH25wI298= +github.com/jfrog/jfrog-client-go v1.28.1-0.20240729103741-f6c521eb9a40 h1:zmh1NwYtbS3GE7jCPWtQpGsTakMo5DHl73BRkZTn6Ag= +github.com/jfrog/jfrog-client-go v1.28.1-0.20240729103741-f6c521eb9a40/go.mod h1:BJqDxNVbs34kuCx9ct6ge3/M39Pf/m5L5IYgZ9p8ap4= github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= @@ -231,8 +231,8 @@ golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2Uz golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= -golang.org/x/exp v0.0.0-20240707233637-46b078467d37 h1:uLDX+AfeFCct3a2C7uIWBKMJIR3CJMhcgfrUAqjRK6w= -golang.org/x/exp v0.0.0-20240707233637-46b078467d37/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= diff --git a/lifecycle/export.go b/lifecycle/export.go index ada57cd46..41001e27f 100644 --- a/lifecycle/export.go +++ b/lifecycle/export.go @@ -52,8 +52,8 @@ func (rbe *ReleaseBundleExportCommand) downloadReleaseBundle(exportResponse serv Pattern: strings.TrimPrefix(exportResponse.RelativeUrl, "/"), Target: rbe.targetPath, }, - MinSplitSizeKb: downloadConfiguration.MinSplitSizeKb, - SplitCount: downloadConfiguration.SplitCount, + MinSplitSize: downloadConfiguration.MinSplitSize, + SplitCount: downloadConfiguration.SplitCount, } artifactoryServiceManager, err := createArtifactoryServiceManager(rbe.serverDetails) if err != nil {