Skip to content

Commit

Permalink
updated AutoSaveIndex doc
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaoxuan Wang <[email protected]>
  • Loading branch information
wangxiaoxuan273 committed Oct 26, 2023
1 parent 0c27fd1 commit 9544f57
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions content/oci/oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,13 @@ import (
// Reference: https://github.com/opencontainers/image-spec/blob/v1.1.0-rc5/image-layout.md
type Store struct {
// AutoSaveIndex controls if the OCI store will automatically save the index
// file on each Tag() call.
// - If AutoSaveIndex is set to true, the OCI store will automatically call
// this method on each Tag() call.
// file when needed.
// - If AutoSaveIndex is set to true, the OCI store will automatically save the
// changes to `index.json` on Tag() and Delete() calls, and when pushing a manifest.
// - If AutoSaveIndex is set to false, it's the caller's responsibility
// to manually call SaveIndex() when needed.
// - Default value: true.

AutoSaveIndex bool
root string
indexPath string
Expand Down Expand Up @@ -318,7 +319,8 @@ func (s *Store) loadIndexFile(ctx context.Context) error {

// SaveIndex writes the `index.json` file to the file system.
// - If AutoSaveIndex is set to true (default value),
// the OCI store will automatically call this method on each Tag() call.
// the OCI store will automatically save the changes to `index.json`
// on Tag() and Delete() calls, and when pushing a manifest.
// - If AutoSaveIndex is set to false, it's the caller's responsibility
// to manually call this method when needed.
func (s *Store) SaveIndex() error {
Expand Down

0 comments on commit 9544f57

Please sign in to comment.