Skip to content

Commit eea5284

Browse files
Madhu-1humblec
authored andcommitted
rbd: check volumeID in PV if image not found
If the pool or few keys are missing in the omap. GetImageAttributes function returns nil error message and few empty items in imageAttributes struct. if the image is not found and the entiries are missing use the volumeId present on the PV annotation for further operations. Signed-off-by: Madhu Rajanna <[email protected]>
1 parent cfc88c9 commit eea5284

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

internal/rbd/rbd_util.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,6 @@ func generateVolumeFromVolumeID(ctx context.Context, volumeID string, cr *util.C
872872
if err != nil {
873873
return rbdVol, err
874874
}
875-
876875
rbdVol.RequestName = imageAttributes.RequestName
877876
rbdVol.RbdImageName = imageAttributes.ImageName
878877
rbdVol.ReservedID = vi.ObjectUUID
@@ -908,7 +907,7 @@ func generateVolumeFromVolumeID(ctx context.Context, volumeID string, cr *util.C
908907
// the structure with elements from on-disk image metadata as well.
909908
func genVolFromVolID(ctx context.Context, volumeID string, cr *util.Credentials, secrets map[string]string) (*rbdVolume, error) {
910909
vol, err := generateVolumeFromVolumeID(ctx, volumeID, cr, secrets)
911-
if !errors.Is(err, util.ErrKeyNotFound) && !errors.Is(err, util.ErrPoolNotFound) {
910+
if !errors.Is(err, util.ErrKeyNotFound) && !errors.Is(err, util.ErrPoolNotFound) && !errors.Is(err, ErrImageNotFound) {
912911
return vol, err
913912
}
914913

0 commit comments

Comments
 (0)