diff options
author | Matthew Heon <matthew.heon@gmail.com> | 2018-03-07 11:17:42 -0500 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-03-08 16:40:21 +0000 |
commit | 221a3ab2b527e8a8877427c20820cdc19d7bae42 (patch) | |
tree | 52b137b3cd9e63798a836b130c428d1242bec5b8 /libpod | |
parent | d23b9fd4ed96cbf03c5da3af6bc5837d9998a75a (diff) | |
download | podman-221a3ab2b527e8a8877427c20820cdc19d7bae42.tar.gz podman-221a3ab2b527e8a8877427c20820cdc19d7bae42.tar.bz2 podman-221a3ab2b527e8a8877427c20820cdc19d7bae42.zip |
Make WriteStringToRundir internal
We don't want this in our public API - better to let us control
what gets put in container storage and where.
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Closes: #462
Approved by: baude
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/container_internal.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go index 6fbaa4546..772eeaa66 100644 --- a/libpod/container_internal.go +++ b/libpod/container_internal.go @@ -414,8 +414,8 @@ func (c *Container) cleanupStorage() error { return c.save() } -// WriteStringToRundir copies the provided file to the runtimedir -func (c *Container) WriteStringToRundir(destFile, output string) (string, error) { +// writeStringToRundir copies the provided file to the runtimedir +func (c *Container) writeStringToRundir(destFile, output string) (string, error) { destFileName := filepath.Join(c.state.RunDir, destFile) f, err := os.Create(destFileName) if err != nil { @@ -455,7 +455,7 @@ func (c *Container) generateResolvConf() (string, error) { return "", errors.Wrapf(err, "unable to read %s", resolvPath) } if len(c.config.DNSServer) == 0 && len(c.config.DNSSearch) == 0 && len(c.config.DNSOption) == 0 { - return c.WriteStringToRundir("resolv.conf", fmt.Sprintf("%s", orig)) + return c.writeStringToRundir("resolv.conf", fmt.Sprintf("%s", orig)) } // Read and organize the hosts /etc/resolv.conf @@ -483,7 +483,7 @@ func (c *Container) generateResolvConf() (string, error) { resolv.options = nil resolv.options = append(resolv.options, c.Config().DNSOption...) } - return c.WriteStringToRundir("resolv.conf", resolv.ToString()) + return c.writeStringToRundir("resolv.conf", resolv.ToString()) } // createResolv creates a resolv struct from an input string @@ -546,12 +546,12 @@ func (c *Container) generateHosts() (string, error) { hosts += fmt.Sprintf("%s %s\n", fields[0], fields[1]) } } - return c.WriteStringToRundir("hosts", hosts) + return c.writeStringToRundir("hosts", hosts) } // generateEtcHostname creates a containers /etc/hostname func (c *Container) generateEtcHostname(hostname string) (string, error) { - return c.WriteStringToRundir("hostname", hostname) + return c.writeStringToRundir("hostname", hostname) } // Generate spec for a container |