Skip to content

Commit

Permalink
Update registry/storage/driver/azure/azure.go
Browse files Browse the repository at this point in the history
Co-authored-by: Cory Snider <corhere@gmail.com>
  • Loading branch information
kirat-singh and corhere committed Apr 25, 2023
1 parent 07fcb17 commit 8cbaab5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions registry/storage/driver/azure/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,15 @@ func (d *driver) Stat(ctx context.Context, path string) (storagedriver.FileInfo,
return nil, err
}
if err == nil {
if props.ContentLength == nil || props.LastModified == nil {
return nil, fmt.Errorf("Invalid blob properties for blob: %s", blobName)
var missing []string
if props.ContentLength == nil {
missing = append(missing, "ContentLength")
if props.LastModified == nil {
missing = append(missing, "LastModified")
}

if len(missing) > 0 {
return nil, fmt.Errorf("required blob properties %s are missing for blob: %s", missing, blobName)
}
return storagedriver.FileInfoInternal{FileInfoFields: storagedriver.FileInfoFields{
Path: path,
Expand Down

0 comments on commit 8cbaab5

Please sign in to comment.