Update removevolume virtctl example.
The example didn't include all examples like addvolume does. Added an
example of removevolume and removevolume with --persist.
@@ -190,7 +190,7 @@ func NewRemoveVolumeCommand(clientConfig clientcmd.ClientConfig) *cobra.Command
cmd := &cobra.Command{
Use: "removevolume VMI",
Short: "remove a volume from a running VM",
- Example: usage(COMMAND_REMOVEVOLUME),
+ Example: usageRemoveVolume(),
Args: templates.ExactArgs("removevolume", 1),
RunE: func(cmd *cobra.Command, args []string) error {
c := Command{command: COMMAND_REMOVEVOLUME, clientConfig: clientConfig}
@@ -257,6 +257,16 @@ func usageAddVolume() string {
return usage
}
+func usageRemoveVolume() string {
+ usage := ` #Remove volume that was dynamically attached to a running VM.
+ {{ProgramName}} removevolume fedora-dv --volume-name=example-dv
+
+ #Remove volume dynamically attached to a running VM and persisting it in the VM spec.
+ {{ProgramName}} removevolume fedora-dv --volume-name=example-dv --persist
+ `
+ return usage
+}
+
func addVolume(vmiName, volumeName, namespace string, virtClient kubecli.KubevirtClient) error {
volumeSource, err := getVolumeSourceFromVolume(volumeName, namespace, virtClient)
if err != nil {
