Skip to content

Commit

Permalink
docs: add doc
Browse files Browse the repository at this point in the history
Signed-off-by: Shiwei Zhang <shizh@microsoft.com>
  • Loading branch information
shizhMSFT committed Jan 23, 2025
1 parent 2000fec commit 7f178d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions oci_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ func (s *OCIStore) FetchImageManifest(ctx context.Context, _ string, desc ocispe
return parseImageManifest(manifestBytes)
}

// parseImageManifest parses the given manifest bytes into an image manifest.
func parseImageManifest(manifestBytes []byte) (*ocispec.Manifest, error) {
var manifest ocispec.Manifest
if err := json.Unmarshal(manifestBytes, &manifest); err != nil {
Expand Down
4 changes: 4 additions & 0 deletions registry_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ func (s *RegistryStore) FetchImageManifest(ctx context.Context, repoRef string,
return parseImageManifest(manifestBytes)

Check warning on line 215 in registry_store.go

View check run for this annotation

Codecov / codecov/patch

registry_store.go#L211-L215

Added lines #L211 - L215 were not covered by tests
}

// repository returns a new remote repository for the given reference with the
// client set.
func (s RegistryStore) repository(ref string) (*remote.Repository, error) {
repo, err := remote.NewRepository(ref)
if err != nil {
Expand All @@ -224,6 +226,8 @@ func (s RegistryStore) repository(ref string) (*remote.Repository, error) {
return repo, nil

Check warning on line 226 in registry_store.go

View check run for this annotation

Codecov / codecov/patch

registry_store.go#L220-L226

Added lines #L220 - L226 were not covered by tests
}

// readOnlyRegistryCredentialStore is wrapper around [RegistryCredentialGetter]
// to implement [credentials.Store] interface.
type readOnlyRegistryCredentialStore struct {
RegistryCredentialGetter
}
Expand Down

0 comments on commit 7f178d3

Please sign in to comment.