Merge pull request #16243 from alexlarsson/volume-create-ignore

Add podman volume create --ignore
This commit is contained in:
OpenShift Merge Robot
2022-10-26 15:00:51 -04:00
committed by GitHub
11 changed files with 80 additions and 18 deletions

View File

@ -70,6 +70,11 @@ func CreateVolume(w http.ResponseWriter, r *http.Request) {
}
volumeOptions = append(volumeOptions, parsedOptions...)
}
if input.IgnoreIfExists {
volumeOptions = append(volumeOptions, libpod.WithVolumeIgnoreIfExist())
}
vol, err := runtime.NewVolume(r.Context(), volumeOptions...)
if err != nil {
utils.InternalServerError(w, err)