fix remove unnecessary err check

Signed-off-by: sianao <me@sianao.site>
This commit is contained in:
sianao
2025-03-27 15:26:49 +08:00
parent a36276f5ad
commit 44cbefff5d

View File

@ -35,14 +35,11 @@ func PodCreate(w http.ResponseWriter, r *http.Request) {
err error
)
psg := specgen.PodSpecGenerator{InfraContainerSpec: &specgen.SpecGenerator{}}
if err := json.NewDecoder(r.Body).Decode(&psg); err != nil {
utils.Error(w, http.StatusInternalServerError, fmt.Errorf("%v: %w", failedToDecodeSpecgen, err))
return
}
if err != nil {
if err = json.NewDecoder(r.Body).Decode(&psg); err != nil {
utils.Error(w, http.StatusInternalServerError, fmt.Errorf("%v: %w", failedToDecodeSpecgen, err))
return
}
if !psg.NoInfra {
infraOptions := entities.NewInfraContainerCreateOptions() // options for pulling the image and FillOutSpec
infraOptions.Net = &entities.NetOptions{}