feat: use a more specific error type for no container info (#1115)

Co-authored-by: Jeremy L. Morris <jmorris@digitalocean.com>
pull/1132/head
Jeremy L. Morris 3 years ago committed by GitHub
parent ac00e4844e
commit d9d6f794a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -285,7 +285,7 @@ func (c Container) VerifyConfiguration() error {
containerInfo := c.ContainerInfo()
if containerInfo == nil {
return errorInvalidConfig
return errorNoContainerInfo
}
containerConfig := containerInfo.Config

@ -23,7 +23,7 @@ var _ = Describe("the container", func() {
c := mockContainerWithPortBindings()
c.containerInfo = nil
err := c.VerifyConfiguration()
Expect(err).To(Equal(errorInvalidConfig))
Expect(err).To(Equal(errorNoContainerInfo))
})
})
When("verifying a container with no config", func() {

@ -3,5 +3,6 @@ package container
import "errors"
var errorNoImageInfo = errors.New("no available image info")
var errorNoContainerInfo = errors.New("no available container info")
var errorNoExposedPorts = errors.New("exposed ports does not match port bindings")
var errorInvalidConfig = errors.New("container configuration missing or invalid")

Loading…
Cancel
Save