Skip to content

Commit d93f1bb

Browse files
committed
fix volumeid validation
1 parent 026b615 commit d93f1bb

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

internal/cmd/volume/snapshot/create/create.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func NewCmd(params *params.CmdParams) *cobra.Command {
119119
}
120120

121121
func configureFlags(cmd *cobra.Command) {
122-
cmd.Flags().String(volumeIdFlag, "", "ID of the volume from which a snapshot should be created")
122+
cmd.Flags().Var(flags.UUIDFlag(), volumeIdFlag, "Volume ID")
123123
cmd.Flags().String(nameFlag, "", "Name of the snapshot")
124124
cmd.Flags().StringToString(labelsFlag, nil, "Key-value string pairs as labels")
125125

@@ -137,9 +137,6 @@ func parseInput(p *print.Printer, cmd *cobra.Command) (*inputModel, error) {
137137
if volumeID == "" {
138138
return nil, fmt.Errorf("volume-id is required")
139139
}
140-
if err := utils.ValidateUUID(volumeID); err != nil {
141-
return nil, fmt.Errorf("volume-id must be a valid UUID")
142-
}
143140

144141
name := flags.FlagToStringPointer(p, cmd, nameFlag)
145142
labels := flags.FlagToStringToStringPointer(p, cmd, labelsFlag)

0 commit comments

Comments
 (0)