Merge pull request #9908 from ktock/transfer-host-dir

Transfer: Registry: Enable to use registry configuration diretory
This commit is contained in:
Derek McGowan
2024-04-02 18:59:43 +00:00
committed by GitHub
6 changed files with 124 additions and 63 deletions

View File

@@ -132,7 +132,10 @@ command. As part of this process, we do the following:
sopts = append(sopts, image.WithAllMetadata)
}
reg := registry.NewOCIRegistry(ref, nil, ch)
reg, err := registry.NewOCIRegistry(ctx, ref, registry.WithCredentials(ch), registry.WithHostDir(context.String("hosts-dir")))
if err != nil {
return err
}
is := image.NewStore(ref, sopts...)
pf, done := ProgressHandler(ctx, os.Stdout)

View File

@@ -104,7 +104,10 @@ var pushCommand = &cli.Command{
if local == "" {
local = ref
}
reg := registry.NewOCIRegistry(ref, nil, ch)
reg, err := registry.NewOCIRegistry(ctx, ref, registry.WithCredentials(ch), registry.WithHostDir(context.String("hosts-dir")))
if err != nil {
return err
}
is := image.NewStore(local)
pf, done := ProgressHandler(ctx, os.Stdout)