Skip to content
Closed
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 internal/task/task/bs/create_volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ func checkCreateStatus(out *string) step.LambdaType {
}
}

func checkDiskSizeStatus(out *string) step.LambdaType {
return func(ctx *context.Context) error {
if *out == "skip task" {
return errno.List()
}
return nil
}
}

func NewCreateVolumeTask(curveadm *cli.CurveAdm, cc *configure.ClientConfig) (*task.Task, error) {
options := curveadm.MemStorage().Get(comm.KEY_MAP_OPTIONS).(MapOptions)
hc, err := curveadm.GetHost(options.Host)
Expand Down Expand Up @@ -117,6 +126,9 @@ func NewCreateVolumeTask(curveadm *cli.CurveAdm, cc *configure.ClientConfig) (*t
t.AddStep(&step.Lambda{
Lambda: checkCreateStatus(&out),
})
t.AddStep(&step.Lambda{
Lambda: checkDiskSizeStatus(&out),
})

return t, nil
}