Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix fmt.Errorf messages #67638

Merged
merged 1 commit into from
Feb 8, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkg/controller/volume/expand/cache/volume_resize_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,21 +185,21 @@ func (resizeMap *volumeResizeMap) UpdatePVSize(pvcr *PVCWithResizeRequest, newSi
oldData, err := json.Marshal(pvClone)

if err != nil {
return fmt.Errorf("Unexpected error marshaling PV : %q with error %v", pvClone.Name, err)
return fmt.Errorf("Unexpected error marshaling old PV %q with error : %v", pvClone.Name, err)
}

pvClone.Spec.Capacity[v1.ResourceStorage] = newSize

newData, err := json.Marshal(pvClone)

if err != nil {
return fmt.Errorf("Unexpected error marshaling PV : %q with error %v", pvClone.Name, err)
return fmt.Errorf("Unexpected error marshaling new PV %q with error : %v", pvClone.Name, err)
}

patchBytes, err := strategicpatch.CreateTwoWayMergePatch(oldData, newData, pvClone)

if err != nil {
return fmt.Errorf("Error Creating two way merge patch for PV : %q with error %v", pvClone.Name, err)
return fmt.Errorf("Error Creating two way merge patch for PV %q with error : %v", pvClone.Name, err)
}

_, updateErr := resizeMap.kubeClient.CoreV1().PersistentVolumes().Patch(pvClone.Name, commontypes.StrategicMergePatchType, patchBytes)
Expand Down