Fix deps and crashing when deleting nonexistant app
This commit is contained in:
parent
863d857283
commit
e0b5832e75
@ -202,13 +202,13 @@ func (d *Driver) Remove(name string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
timeout := time.Duration(dockerTimeout * time.Second)
|
timeout := dockerTimeout
|
||||||
err = cli.ContainerStop(context.TODO(), containerID, &timeout)
|
err = cli.ContainerStop(context.TODO(), containerID, container.StopOptions{Timeout: &timeout})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
err = cli.ContainerRemove(context.TODO(), containerID, types.ContainerRemoveOptions{})
|
err = cli.ContainerRemove(context.TODO(), containerID, container.RemoveOptions{})
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -246,8 +246,8 @@ func (d *Driver) Stop(name string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
timeout := time.Duration(dockerTimeout * time.Second)
|
timeout := dockerTimeout
|
||||||
err = cli.ContainerStop(context.TODO(), containerID, &timeout)
|
err = cli.ContainerStop(context.TODO(), containerID, container.StopOptions{Timeout: &timeout})
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -450,6 +450,7 @@ func (p *Processor) Delete() error {
|
|||||||
container, err := p.getContainer()
|
container, err := p.getContainer()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println("ERROR: delete app:", err.Error())
|
log.Println("ERROR: delete app:", err.Error())
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
status, err := container.Status()
|
status, err := container.Status()
|
||||||
|
23
go.mod
23
go.mod
@ -3,30 +3,31 @@ module github.com/rosti-cz/node-api
|
|||||||
go 1.14
|
go 1.14
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/Microsoft/go-winio v0.4.18 // indirect
|
github.com/Microsoft/go-winio v0.6.1 // indirect
|
||||||
github.com/StackExchange/wmi v0.0.0-20210224194228-fe8f1750fd46 // indirect
|
github.com/StackExchange/wmi v1.2.1 // indirect
|
||||||
github.com/containerd/containerd v1.5.9 // indirect
|
github.com/containerd/log v0.1.0 // indirect
|
||||||
github.com/docker/docker v20.10.12+incompatible
|
github.com/distribution/reference v0.5.0 // indirect
|
||||||
|
github.com/docker/docker v25.0.3+incompatible
|
||||||
github.com/docker/go-connections v0.4.0
|
github.com/docker/go-connections v0.4.0
|
||||||
|
github.com/docker/go-units v0.5.0 // indirect
|
||||||
github.com/getsentry/sentry-go v0.26.0
|
github.com/getsentry/sentry-go v0.26.0
|
||||||
github.com/gobuffalo/packr v1.30.1
|
github.com/gobuffalo/packr v1.30.1
|
||||||
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect
|
github.com/gogo/protobuf v1.3.2 // indirect
|
||||||
github.com/gorilla/mux v1.8.0 // indirect
|
|
||||||
github.com/jinzhu/gorm v1.9.14
|
github.com/jinzhu/gorm v1.9.14
|
||||||
github.com/kelseyhightower/envconfig v1.4.0
|
github.com/kelseyhightower/envconfig v1.4.0
|
||||||
github.com/labstack/echo/v4 v4.10.0
|
github.com/labstack/echo/v4 v4.10.0
|
||||||
github.com/mattn/go-sqlite3 v1.14.17 // indirect
|
|
||||||
github.com/minio/minio-go/v7 v7.0.14
|
github.com/minio/minio-go/v7 v7.0.14
|
||||||
github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // indirect
|
github.com/moby/term v0.5.0 // indirect
|
||||||
github.com/morikuni/aec v1.0.0 // indirect
|
github.com/morikuni/aec v1.0.0 // indirect
|
||||||
github.com/nats-io/nats.go v1.23.0
|
github.com/nats-io/nats.go v1.23.0
|
||||||
github.com/opencontainers/image-spec v1.0.2
|
github.com/opencontainers/image-spec v1.0.2
|
||||||
github.com/pkg/errors v0.9.1
|
github.com/pkg/errors v0.9.1
|
||||||
github.com/satori/go.uuid v1.2.0
|
github.com/satori/go.uuid v1.2.0
|
||||||
github.com/shirou/gopsutil v2.20.6+incompatible
|
github.com/shirou/gopsutil v2.20.6+incompatible
|
||||||
github.com/stretchr/testify v1.8.2
|
github.com/stretchr/testify v1.8.4
|
||||||
google.golang.org/grpc v1.44.0 // indirect
|
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
|
||||||
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0 // indirect
|
||||||
gorm.io/driver/mysql v1.4.7
|
gorm.io/driver/mysql v1.4.7
|
||||||
gorm.io/gorm v1.25.2-0.20230530020048-26663ab9bf55
|
gorm.io/gorm v1.25.2-0.20230530020048-26663ab9bf55
|
||||||
gotest.tools/v3 v3.1.0 // indirect
|
gotest.tools/v3 v3.5.1 // indirect
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user