mirror of
https://github.com/harness/drone.git
synced 2025-05-10 05:01:41 +08:00
feat: [AH-690]: log errors (#3026)
* feat: [AH-690]: log errors * fix: [AH-597]: fix layers api for application/vnd.oci.image.manifest.v1+json manifests
This commit is contained in:
parent
036f615cc0
commit
eb6af94cbd
@ -171,7 +171,7 @@ func getManifestLayers(
|
|||||||
return deserializedManifest.Layers(), nil
|
return deserializedManifest.Layers(), nil
|
||||||
case *ocischema.DeserializedManifest:
|
case *ocischema.DeserializedManifest:
|
||||||
deserializedManifest := &ocischema.DeserializedManifest{}
|
deserializedManifest := &ocischema.DeserializedManifest{}
|
||||||
mediaType, bytes, _ := deserializedManifest.Payload()
|
mediaType, bytes, _ := manifest.Payload()
|
||||||
err := deserializedManifest.UnmarshalJSON(bytes)
|
err := deserializedManifest.UnmarshalJSON(bytes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to unmarshal %s manifest: %w", mediaType, err)
|
return nil, fmt.Errorf("failed to unmarshal %s manifest: %w", mediaType, err)
|
||||||
|
@ -25,6 +25,8 @@ import (
|
|||||||
"github.com/harness/gitness/registry/app/store"
|
"github.com/harness/gitness/registry/app/store"
|
||||||
"github.com/harness/gitness/types"
|
"github.com/harness/gitness/types"
|
||||||
"github.com/harness/gitness/types/enum"
|
"github.com/harness/gitness/types/enum"
|
||||||
|
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetRegistryCheckAccess fetches an active registry
|
// GetRegistryCheckAccess fetches an active registry
|
||||||
@ -62,7 +64,9 @@ func GetRegistryCheckAccess(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if err = apiauth.CheckRegistry(ctx, authorizer, session, permissionChecks...); err != nil {
|
if err = apiauth.CheckRegistry(ctx, authorizer, session, permissionChecks...); err != nil {
|
||||||
return fmt.Errorf("access check failed: %w", err)
|
err = fmt.Errorf("registgry access check failed: %w", err)
|
||||||
|
log.Ctx(ctx).Error().Msgf("Error: %v", err)
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user