Skip to content

Commit

Permalink
go/runtime/bundle: Fix comments and errors
Browse files Browse the repository at this point in the history
  • Loading branch information
peternose committed Dec 11, 2024
1 parent c003abb commit 9ffa8da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go/runtime/bundle/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ func (d *Discovery) copyBundle(src string) error {
"src", src,
"dst", dst,
)
return fmt.Errorf("failed to open bundle: %w", err)
return fmt.Errorf("failed to copy bundle: %w", err)
}

d.logger.Info("bundle copied",
Expand Down
6 changes: 4 additions & 2 deletions go/runtime/bundle/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ func (r *registry) AddBundle(path string, manifestHash hash.Hash) error {
}
defer bnd.Close()

// Verify manifest hash.
// Verify that the manifest hash belongs to the bundle before checking
// if the bundle is already in the registry.
if !bnd.manifestHash.Equal(&manifestHash) {
return fmt.Errorf("invalid manifest hash (got: '%s', expected: '%s')",
bnd.manifestHash.Hex(),
Expand All @@ -119,7 +120,8 @@ func (r *registry) AddBundle(path string, manifestHash hash.Hash) error {
return nil
}

// Verify that components are unique.
// Ensure the manifest doesn't include a component version already
// in the registry.
components := bnd.Manifest.GetAvailableComponents()

for compID, comp := range components {
Expand Down

0 comments on commit 9ffa8da

Please sign in to comment.