From e128f175089d2508dae0a39f4ec86d4733d1ee44 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 9 Aug 2019 15:01:40 +0200 Subject: [PATCH] Rename variable for consistency Signed-off-by: Sebastiaan van Stijn --- daemon/container_operations_unix.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/daemon/container_operations_unix.go b/daemon/container_operations_unix.go index 3fcdc1913b..3098cc00ad 100644 --- a/daemon/container_operations_unix.go +++ b/daemon/container_operations_unix.go @@ -227,13 +227,13 @@ func (daemon *Daemon) setupSecretDir(c *container.Container) (setupErr error) { } } - for _, ref := range c.ConfigReferences { + for _, configRef := range c.ConfigReferences { // TODO (ehazlett): use type switch when more are supported - if ref.File == nil { + if configRef.File == nil { // Runtime configs are not mounted into the container, but they're // a valid type of config so we should not error when we encounter // one. - if ref.Runtime == nil { + if configRef.Runtime == nil { logrus.Error("config target type is not a file or runtime target") } // However, in any case, this isn't a file config, so we have no @@ -241,7 +241,7 @@ func (daemon *Daemon) setupSecretDir(c *container.Container) (setupErr error) { continue } - fPath, err := c.ConfigFilePath(*ref) + fPath, err := c.ConfigFilePath(*configRef) if err != nil { return errors.Wrap(err, "error getting config file path for container") } @@ -250,22 +250,22 @@ func (daemon *Daemon) setupSecretDir(c *container.Container) (setupErr error) { } logrus.WithFields(logrus.Fields{ - "name": ref.File.Name, + "name": configRef.File.Name, "path": fPath, }).Debug("injecting config") - config, err := c.DependencyStore.Configs().Get(ref.ConfigID) + config, err := c.DependencyStore.Configs().Get(configRef.ConfigID) if err != nil { return errors.Wrap(err, "unable to get config from config store") } - if err := ioutil.WriteFile(fPath, config.Spec.Data, ref.File.Mode); err != nil { + if err := ioutil.WriteFile(fPath, config.Spec.Data, configRef.File.Mode); err != nil { return errors.Wrap(err, "error injecting config") } - uid, err := strconv.Atoi(ref.File.UID) + uid, err := strconv.Atoi(configRef.File.UID) if err != nil { return err } - gid, err := strconv.Atoi(ref.File.GID) + gid, err := strconv.Atoi(configRef.File.GID) if err != nil { return err } @@ -273,7 +273,7 @@ func (daemon *Daemon) setupSecretDir(c *container.Container) (setupErr error) { if err := os.Chown(fPath, rootIDs.UID+uid, rootIDs.GID+gid); err != nil { return errors.Wrap(err, "error setting ownership for config") } - if err := os.Chmod(fPath, ref.File.Mode); err != nil { + if err := os.Chmod(fPath, configRef.File.Mode); err != nil { return errors.Wrap(err, "error setting file mode for config") } }