Skip to content

Commit

Permalink
add operation name for other volume operations
Browse files Browse the repository at this point in the history
  • Loading branch information
caiweidong committed Apr 12, 2019
1 parent 6c22cff commit 7c9e567
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/volume/util/operationexecutor/operation_generator.go
Expand Up @@ -211,6 +211,7 @@ func (og *operationGenerator) GenerateVolumesAreAttachedFunc(
}

return volumetypes.GeneratedOperations{
OperationName: "verify_volumes_are_attached_per_node",
OperationFunc: volumesAreAttachedFunc,
CompleteFunc: util.OperationCompleteHook(util.GetFullQualifiedPluginNameForVolume("<n/a>", nil), "verify_volumes_are_attached_per_node"),
EventRecorderFunc: nil, // nil because we do not want to generate event on error
Expand Down Expand Up @@ -282,6 +283,7 @@ func (og *operationGenerator) GenerateBulkVolumeVerifyFunc(
}

return volumetypes.GeneratedOperations{
OperationName: "verify_volumes_are_attached",
OperationFunc: bulkVolumeVerifyFunc,
CompleteFunc: util.OperationCompleteHook(util.GetFullQualifiedPluginNameForVolume(pluginName, nil), "verify_volumes_are_attached"),
EventRecorderFunc: nil, // nil because we do not want to generate event on error
Expand Down Expand Up @@ -388,6 +390,7 @@ func (og *operationGenerator) GenerateAttachVolumeFunc(
}

return volumetypes.GeneratedOperations{
OperationName: "volume_attach",
OperationFunc: attachVolumeFunc,
EventRecorderFunc: eventRecorderFunc,
CompleteFunc: util.OperationCompleteHook(util.GetFullQualifiedPluginNameForVolume(attachableVolumePlugin.GetPluginName(), volumeToAttach.VolumeSpec), "volume_attach"),
Expand Down Expand Up @@ -507,6 +510,7 @@ func (og *operationGenerator) GenerateDetachVolumeFunc(
}

return volumetypes.GeneratedOperations{
OperationName: "volume_detach",
OperationFunc: getVolumePluginMgrFunc,
CompleteFunc: util.OperationCompleteHook(util.GetFullQualifiedPluginNameForVolume(pluginName, volumeToDetach.VolumeSpec), "volume_detach"),
EventRecorderFunc: nil, // nil because we do not want to generate event on error
Expand Down Expand Up @@ -1093,6 +1097,7 @@ func (og *operationGenerator) GenerateMapVolumeFunc(
}

return volumetypes.GeneratedOperations{
OperationName: "map_volume",
OperationFunc: mapVolumeFunc,
EventRecorderFunc: eventRecorderFunc,
CompleteFunc: util.OperationCompleteHook(util.GetFullQualifiedPluginNameForVolume(blockVolumePlugin.GetPluginName(), volumeToMount.VolumeSpec), "map_volume"),
Expand Down Expand Up @@ -1163,6 +1168,7 @@ func (og *operationGenerator) GenerateUnmapVolumeFunc(
}

return volumetypes.GeneratedOperations{
OperationName: "unmap_volume",
OperationFunc: unmapVolumeFunc,
CompleteFunc: util.OperationCompleteHook(util.GetFullQualifiedPluginNameForVolume(blockVolumePlugin.GetPluginName(), volumeToUnmount.VolumeSpec), "unmap_volume"),
EventRecorderFunc: nil, // nil because we do not want to generate event on error
Expand Down Expand Up @@ -1278,6 +1284,7 @@ func (og *operationGenerator) GenerateUnmapDeviceFunc(
}

return volumetypes.GeneratedOperations{
OperationName: "unmap_device",
OperationFunc: unmapDeviceFunc,
CompleteFunc: util.OperationCompleteHook(util.GetFullQualifiedPluginNameForVolume(blockVolumePlugin.GetPluginName(), deviceToDetach.VolumeSpec), "unmap_device"),
EventRecorderFunc: nil, // nil because we do not want to generate event on error
Expand Down Expand Up @@ -1352,6 +1359,7 @@ func (og *operationGenerator) GenerateVerifyControllerAttachedVolumeFunc(
}

return volumetypes.GeneratedOperations{
OperationName: "verify_controller_attached_volume",
OperationFunc: verifyControllerAttachedVolumeFunc,
CompleteFunc: util.OperationCompleteHook(util.GetFullQualifiedPluginNameForVolume(volumePlugin.GetPluginName(), volumeToMount.VolumeSpec), "verify_controller_attached_volume"),
EventRecorderFunc: nil, // nil because we do not want to generate event on error
Expand Down Expand Up @@ -1468,6 +1476,7 @@ func (og *operationGenerator) GenerateExpandVolumeFunc(
}

return volumetypes.GeneratedOperations{
OperationName: "expand_volume",
OperationFunc: expandVolumeFunc,
EventRecorderFunc: eventRecorderFunc,
CompleteFunc: util.OperationCompleteHook(util.GetFullQualifiedPluginNameForVolume(volumePlugin.GetPluginName(), volumeSpec), "expand_volume"),
Expand Down Expand Up @@ -1542,6 +1551,7 @@ func (og *operationGenerator) GenerateExpandVolumeFSWithoutUnmountingFunc(
}

return volumetypes.GeneratedOperations{
OperationName: "volume_fs_resize",
OperationFunc: fsResizeFunc,
EventRecorderFunc: eventRecorderFunc,
CompleteFunc: util.OperationCompleteHook(util.GetFullQualifiedPluginNameForVolume(volumePlugin.GetPluginName(), volumeToMount.VolumeSpec), "volume_fs_resize"),
Expand Down

0 comments on commit 7c9e567

Please sign in to comment.