-
Notifications
You must be signed in to change notification settings - Fork 292
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
manifest: use pack home directory to store local manifests
Signed-off-by: Husni Faiz <[email protected]>
- Loading branch information
1 parent
e1d7964
commit afc2669
Showing
9 changed files
with
97 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,33 @@ | ||
package client | ||
|
||
import "context" | ||
import ( | ||
"context" | ||
|
||
"github.com/buildpacks/imgutil/local" | ||
"github.com/buildpacks/imgutil/remote" | ||
) | ||
|
||
type PushManifestOptions struct { | ||
Index string | ||
Path string | ||
} | ||
|
||
func (c *Client) PushManifest(ctx context.Context, opts PushManifestOptions) error { | ||
indexManifest, err := local.GetIndexManifest(opts.Index, opts.Path) | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
idx, err := remote.NewIndex(opts.Index, c.keychain, remote.WithManifest(indexManifest)) | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
// Store index | ||
err = idx.Save() | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
return nil | ||
} |