diff options
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/container_internal.go | 8 | ||||
-rw-r--r-- | libpod/sql_state_internal.go | 1 | ||||
-rw-r--r-- | libpod/state_test.go | 6 |
3 files changed, 6 insertions, 9 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go index d434630a3..858cf3cbe 100644 --- a/libpod/container_internal.go +++ b/libpod/container_internal.go @@ -424,7 +424,7 @@ func (c *Container) WriteStringToRundir(destFile, output string) (string, error) return destFileName, nil } -type resolv struct { +type resolvConf struct { nameServers []string searchDomains []string options []string @@ -477,8 +477,8 @@ func (c *Container) generateResolvConf() (string, error) { } // createResolv creates a resolv struct from an input string -func createResolv(input string) resolv { - var resolv resolv +func createResolv(input string) resolvConf { + var resolv resolvConf for _, line := range strings.Split(input, "\n") { if strings.HasPrefix(line, "search") { fields := strings.Fields(line) @@ -507,7 +507,7 @@ func createResolv(input string) resolv { } //ToString returns a resolv struct in the form of a resolv.conf -func (r resolv) ToString() string { +func (r resolvConf) ToString() string { var result string // Populate the output string with search domains result += fmt.Sprintf("search %s\n", strings.Join(r.searchDomains, " ")) diff --git a/libpod/sql_state_internal.go b/libpod/sql_state_internal.go index 5a1b68615..5bc2d84f5 100644 --- a/libpod/sql_state_internal.go +++ b/libpod/sql_state_internal.go @@ -37,6 +37,7 @@ const ( FROM containers INNER JOIN containerState ON containers.Id = containerState.Id ` + // ExistsQuery is a query to check if a pod exists ExistsQuery = "SELECT 1 FROM pods WHERE Id=?;" ) diff --git a/libpod/state_test.go b/libpod/state_test.go index f18393e23..b98674134 100644 --- a/libpod/state_test.go +++ b/libpod/state_test.go @@ -1119,7 +1119,6 @@ func TestAddPodDuplicateNameFails(t *testing.T) { err = state.AddPod(testPod2) assert.Error(t, err) - allPods, err := state.AllPods() assert.NoError(t, err) assert.Equal(t, 1, len(allPods)) @@ -1160,7 +1159,6 @@ func TestAddPodCtrIDConflictFails(t *testing.T) { err = state.AddPod(testPod) assert.Error(t, err) - allPods, err := state.AllPods() assert.NoError(t, err) assert.Equal(t, 0, len(allPods)) @@ -1181,7 +1179,6 @@ func TestAddPodCtrNameConflictFails(t *testing.T) { err = state.AddPod(testPod) assert.Error(t, err) - allPods, err := state.AllPods() assert.NoError(t, err) assert.Equal(t, 0, len(allPods)) @@ -1270,7 +1267,6 @@ func TestRemovePodNotEmptyFails(t *testing.T) { err = state.RemovePod(testPod) assert.Error(t, err) - allPods, err := state.AllPods() assert.NoError(t, err) assert.Equal(t, 1, len(allPods)) @@ -1305,7 +1301,7 @@ func TestRemovePodAfterEmptySucceeds(t *testing.T) { } func TestAllPodsEmptyOnEmptyState(t *testing.T) { - runForAllStates(t , func(t *testing.T, state State, lockPath string) { + runForAllStates(t, func(t *testing.T, state State, lockPath string) { allPods, err := state.AllPods() assert.NoError(t, err) assert.Equal(t, 0, len(allPods)) |