Skip to content

Commit

Permalink
Merge pull request #2893 from cvmfs/ducc-image-pull-cache
Browse files Browse the repository at this point in the history
Adding support for image registry proxies
  • Loading branch information
jblomer committed Aug 29, 2022
2 parents c424e1a + fe32443 commit 983554a
Show file tree
Hide file tree
Showing 4 changed files with 227 additions and 91 deletions.
1 change: 1 addition & 0 deletions ducc/cmd/root.go
Expand Up @@ -24,6 +24,7 @@ var rootCmd = &cobra.Command{
Short: "Show the several commands available.",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
lib.SetupNotification()
lib.SetupRegistries()
},
Run: func(cmd *cobra.Command, args []string) {
cmd.Help()
Expand Down
17 changes: 17 additions & 0 deletions ducc/docker-api/util.go
Expand Up @@ -27,6 +27,23 @@ type Manifest struct {
Layers []Layer
}

type ManifestList struct {
SchemaVersion int
MediaType string
Manifests []ManifestListItem
}

type ManifestListItem struct {
MediaType string
Size int
Digest string
Platform struct {
Architecture string
OS string
Variant *string
}
}

type ThinImageLayer struct {
Digest string `json:"digest"`
Url string `json:"url,omitempty"`
Expand Down
6 changes: 3 additions & 3 deletions ducc/lib/conversion.go
Expand Up @@ -318,11 +318,11 @@ func convertInputOutput(inputImage *Image, repo string, convertAgain, forceDownl
}
manifestPath := filepath.Join("/", "cvmfs", repo, ".metadata", inputImage.GetSimpleName(), "manifest.json")
alreadyConverted := AlreadyConverted(manifestPath, manifest.Config.Digest)
l.Log().WithFields(log.Fields{"alreadyConverted": alreadyConverted}).Info(
"Already converted the image, skipping.")

if alreadyConverted == ConversionMatch {
if convertAgain == false {
if !convertAgain {
l.Log().WithFields(log.Fields{"alreadyConverted": alreadyConverted}).Info(
"Already converted the image, skipping.")
return nil
}
}
Expand Down

0 comments on commit 983554a

Please sign in to comment.