We are using err in defer function, needs to be defined name

Since we are checking if err is non nil in defer function we need
to define it, so that the check will work correctly.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #985
Approved by: mheon
This commit is contained in:
Daniel J Walsh 2018-06-22 05:29:56 -04:00 committed by Atomic Bot
parent 2c81a756e3
commit 1d9e884232
3 changed files with 3 additions and 3 deletions

View File

@ -701,7 +701,7 @@ func (c *Container) Sync() error {
} }
// RestartWithTimeout restarts a running container and takes a given timeout in uint // RestartWithTimeout restarts a running container and takes a given timeout in uint
func (c *Container) RestartWithTimeout(ctx context.Context, timeout uint) error { func (c *Container) RestartWithTimeout(ctx context.Context, timeout uint) (err error) {
if !c.batched { if !c.batched {
c.lock.Lock() c.lock.Lock()
defer c.lock.Unlock() defer c.lock.Unlock()

View File

@ -294,7 +294,7 @@ func NewRuntimeFromConfig(configPath string, options ...RuntimeOption) (runtime
// Make a new runtime based on the given configuration // Make a new runtime based on the given configuration
// Sets up containers/storage, state store, OCI runtime // Sets up containers/storage, state store, OCI runtime
func makeRuntime(runtime *Runtime) error { func makeRuntime(runtime *Runtime) (err error) {
// Find a working OCI runtime binary // Find a working OCI runtime binary
foundRuntime := false foundRuntime := false
for _, path := range runtime.config.RuntimePath { for _, path := range runtime.config.RuntimePath {

View File

@ -59,7 +59,7 @@ func (metadata *RuntimeContainerMetadata) SetMountLabel(mountLabel string) {
// CreateContainerStorage creates the storage end of things. We already have the container spec created // CreateContainerStorage creates the storage end of things. We already have the container spec created
// TO-DO We should be passing in an Image object in the future. // TO-DO We should be passing in an Image object in the future.
func (r *storageService) CreateContainerStorage(ctx context.Context, systemContext *types.SystemContext, imageName, imageID, containerName, containerID, mountLabel string, options *storage.ContainerOptions) (ContainerInfo, error) { func (r *storageService) CreateContainerStorage(ctx context.Context, systemContext *types.SystemContext, imageName, imageID, containerName, containerID, mountLabel string, options *storage.ContainerOptions) (cinfo ContainerInfo, err error) {
var imageConfig *v1.Image var imageConfig *v1.Image
if imageName != "" { if imageName != "" {
var ref types.ImageReference var ref types.ImageReference