Skip to content

Commit

Permalink
Improve logging (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
afritzler authored Mar 14, 2023
1 parent c15524c commit c16bb70
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/driver/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ func (d *driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
if err := d.onmetalClient.Patch(ctx, volume, client.Apply, volumeFieldOwner, client.ForceOwnership); err != nil {
return nil, status.Errorf(codes.Internal, "Failed to patch volume %s: %v", client.ObjectKeyFromObject(volume), err)
}
klog.InfoS("Applied volume", "Volume", client.ObjectKeyFromObject(volume))

klog.InfoS("Created volume", "Volume", client.ObjectKeyFromObject(volume))
return &csi.CreateVolumeResponse{
Volume: &csi.Volume{
VolumeId: req.GetName(),
Expand Down Expand Up @@ -171,12 +171,12 @@ func (d *driver) ControllerPublishVolume(ctx context.Context, req *csi.Controlle
machine := &computev1alpha1.Machine{}
machineKey := client.ObjectKey{Namespace: d.config.DriverNamespace, Name: req.GetNodeId()}

klog.InfoS("Get machine to attach volume", "Machine", machineKey, "Volume", req.GetVolumeId())
klog.InfoS("Get machine for volume attachment", "Machine", machineKey, "Volume", req.GetVolumeId())
if err := d.onmetalClient.Get(ctx, machineKey, machine); err != nil {
return nil, status.Errorf(codes.Internal, "Failed to get machine %s: %v", client.ObjectKeyFromObject(machine), err)
}
volumeAttachmentName := req.GetVolumeId() + "-attachment"
klog.InfoS("Adding attached volumes to machine", "Machine", client.ObjectKeyFromObject(machine))
klog.InfoS("Attaching volume to machine", "Machine", client.ObjectKeyFromObject(machine))
idx := volumeAttachmentIndex(machine.Spec.Volumes, volumeAttachmentName)
if idx < 0 {
machineBase := machine.DeepCopy()
Expand Down

0 comments on commit c16bb70

Please sign in to comment.