Skip to content

Log operation id for attach and detach #871

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

Merged
merged 1 commit into from
Dec 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions pkg/gce-cloud-provider/compute/gce-compute.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ func (cloud *CloudProvider) insertRegionalDisk(
}
return status.Error(codes.Internal, fmt.Sprintf("unknown Insert disk error: %v", err))
}
klog.V(5).Infof("InsertDisk operation %s for disk %s", opName, diskToCreate.Name)

err = cloud.waitForRegionalOp(ctx, project, opName, volKey.Region)
if err != nil {
Expand Down Expand Up @@ -536,6 +537,7 @@ func (cloud *CloudProvider) insertZonalDisk(
}
return fmt.Errorf("unknown Insert disk error: %v", err)
}
klog.V(5).Infof("InsertDisk operation %s for disk %s", opName, diskToCreate.Name)

err = cloud.waitForZonalOp(ctx, project, opName, volKey.Zone)

Expand Down Expand Up @@ -581,6 +583,8 @@ func (cloud *CloudProvider) deleteZonalDisk(ctx context.Context, project, zone,
}
return err
}
klog.V(5).Infof("DeleteDisk operation %s for disk %s", op.Name, name)

err = cloud.waitForZonalOp(ctx, project, op.Name, zone)
if err != nil {
return err
Expand All @@ -597,6 +601,8 @@ func (cloud *CloudProvider) deleteRegionalDisk(ctx context.Context, project, reg
}
return err
}
klog.V(5).Infof("DeleteDisk operation %s for disk %s", op.Name, name)

err = cloud.waitForRegionalOp(ctx, project, op.Name, region)
if err != nil {
return err
Expand Down Expand Up @@ -624,6 +630,8 @@ func (cloud *CloudProvider) AttachDisk(ctx context.Context, project string, volK
if err != nil {
return fmt.Errorf("failed cloud service attach disk call: %v", err)
}
klog.V(5).Infof("AttachDisk operation %s for disk %s", op.Name, attachedDiskV1.DeviceName)

err = cloud.waitForZonalOp(ctx, project, op.Name, instanceZone)
if err != nil {
return fmt.Errorf("failed when waiting for zonal op: %v", err)
Expand All @@ -637,6 +645,8 @@ func (cloud *CloudProvider) DetachDisk(ctx context.Context, project, deviceName,
if err != nil {
return err
}
klog.V(5).Infof("DetachDisk operation %s for disk %s", op.Name, deviceName)

err = cloud.waitForZonalOp(ctx, project, op.Name, instanceZone)
if err != nil {
return err
Expand Down Expand Up @@ -849,6 +859,7 @@ func (cloud *CloudProvider) resizeZonalDisk(ctx context.Context, project string,
if err != nil {
return -1, fmt.Errorf("failed to resize zonal volume %v: %v", volKey.String(), err)
}
klog.V(5).Infof("ResizeDisk operation %s for disk %s", op.Name, volKey.Name)

err = cloud.waitForZonalOp(ctx, project, op.Name, volKey.Zone)
if err != nil {
Expand All @@ -867,6 +878,7 @@ func (cloud *CloudProvider) resizeRegionalDisk(ctx context.Context, project stri
if err != nil {
return -1, fmt.Errorf("failed to resize regional volume %v: %v", volKey.String(), err)
}
klog.V(5).Infof("ResizeDisk operation %s for disk %s", op.Name, volKey.Name)

err = cloud.waitForRegionalOp(ctx, project, op.Name, volKey.Region)
if err != nil {
Expand Down