Skip to content

Commit b35c817

Browse files
committed
chore: push meta files into the right directory
1 parent 01d1a25 commit b35c817

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

cmd/registry_push_meta.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313
var PushMetaCommand = &cobra.Command{
1414
Use: "meta",
15-
Short: "Generate Meta OCI Artifacts and push to a remote registry.",
15+
Short: "Push .meta OCI Artifacts from a scroll directory to a remote registry.",
1616
Args: cobra.RangeArgs(1, 2),
1717
RunE: func(cmd *cobra.Command, args []string) error {
1818

@@ -22,14 +22,14 @@ var PushMetaCommand = &cobra.Command{
2222
}
2323

2424
artifact := args[0]
25-
folder := "."
25+
scrollDir := "."
2626
if len(args) == 2 {
27-
folder = args[1]
27+
scrollDir = args[1]
2828
}
2929

30-
fullPath := path.Join(cwd, folder)
30+
fullPath := path.Join(cwd, scrollDir)
3131

32-
logger.Log().Info("Pushing "+artifact+" meta to registry", zap.String("path", fullPath))
32+
logger.Log().Info("Pushing "+artifact+" meta to registry", zap.String("scrollDir", fullPath))
3333

3434
ociClient := registry.NewOciClient(credStore)
3535

internal/core/services/registry/oci.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ func (c *OciClient) packFolders(fs *file.Store, dirs []string, artifactType doma
402402
zap.String("artifactType", string(artifactType)),
403403
)
404404

405-
fileDescriptor, err := fs.Add(ctx, name, string(artifactType), fullPath)
405+
fileDescriptor, err := fs.Add(ctx, fullPath, string(artifactType), fullPath)
406406
if err != nil {
407407
return []v1.Descriptor{}, err
408408
}
@@ -696,7 +696,7 @@ func (c *OciClient) Push(folder string, repo string, tag string, overrides map[s
696696
return rootManifestDescriptor, nil
697697
}
698698

699-
func (c *OciClient) PushMeta(folder string, repo string) (v1.Descriptor, error) {
699+
func (c *OciClient) PushMeta(scrollDir string, repo string) (v1.Descriptor, error) {
700700
ctx := context.Background()
701701

702702
// Authenticate before doing any expensive local work.
@@ -708,13 +708,13 @@ func (c *OciClient) PushMeta(folder string, repo string) (v1.Descriptor, error)
708708
return v1.Descriptor{}, err
709709
}
710710

711-
fs, err := file.New(folder)
711+
fs, err := file.New(scrollDir)
712712
if err != nil {
713713
return v1.Descriptor{}, err
714714
}
715715
defer fs.Close()
716716

717-
manifestDescriptors, err := c.createMetaDescriptors(fs, folder, "")
717+
manifestDescriptors, err := c.createMetaDescriptors(fs, scrollDir, ".meta")
718718
if err != nil {
719719
return v1.Descriptor{}, err
720720
}

0 commit comments

Comments
 (0)