diff --git a/go/runtime/bundle/discovery.go b/go/runtime/bundle/discovery.go index 6251205554a..058ac55e3db 100644 --- a/go/runtime/bundle/discovery.go +++ b/go/runtime/bundle/discovery.go @@ -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", diff --git a/go/runtime/bundle/registry.go b/go/runtime/bundle/registry.go index b72ff6b25af..a2bb87ac023 100644 --- a/go/runtime/bundle/registry.go +++ b/go/runtime/bundle/registry.go @@ -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(), @@ -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 {