diff --git a/pkg/webhook/cspc.go b/pkg/webhook/cspc.go index 6d415e2ce4..64333a08ea 100644 --- a/pkg/webhook/cspc.go +++ b/pkg/webhook/cspc.go @@ -337,12 +337,9 @@ func (poolValidator *PoolValidator) blockDeviceClaimValidation(bdcName, bdName s "could not get block device claim for block device {%s}", bdName) } cspcName := bdcObject. - GetAnnotations()[string(apis.CStorPoolClusterCPK)] + GetLabels()[string(apis.CStorPoolClusterCPK)] if cspcName != poolValidator.cspcName { - return errors.Wrapf(err, - "cann't use claimed blockdevice %s", - bdName, - ) + return errors.Errorf("can't use claimed blockdevice %s", bdName) } return nil }