mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-17 20:00:23 +00:00
Fix error checking issue in json Decode
Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
This commit is contained in:
parent
1d11d0acc3
commit
4c564207c6
@ -69,7 +69,7 @@ func getCephUser(adminCr *credentials, volID volumeID) (*cephEntity, error) {
|
|||||||
// Contains non-json data: "exported keyring for ENTITY\n\n"
|
// Contains non-json data: "exported keyring for ENTITY\n\n"
|
||||||
offset := bytes.Index(out, []byte("[{"))
|
offset := bytes.Index(out, []byte("[{"))
|
||||||
|
|
||||||
if json.NewDecoder(bytes.NewReader(out[offset:])).Decode(&ents); err != nil {
|
if err = json.NewDecoder(bytes.NewReader(out[offset:])).Decode(&ents); err != nil {
|
||||||
return nil, fmt.Errorf("failed to decode json: %v", err)
|
return nil, fmt.Errorf("failed to decode json: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user