Skip to content

Commit

Permalink
Fix default definition of secrets in containers.conf
Browse files Browse the repository at this point in the history
We had a bogus setting for secrets in our default containers.conf
[secret] should have been [secrets].

Also added a test to make sure this never happens again.

Signed-off-by: Daniel J Walsh <[email protected]>
  • Loading branch information
rhatdan committed Jul 5, 2021
1 parent 9d34b37 commit ca5f9ee
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/containers.conf.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ Currently valid values are:
* file
* pass

**opts**={}
**[secrets.opts]**

The driver specific options object.

Expand Down
10 changes: 10 additions & 0 deletions pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,16 @@ var _ = Describe("Config", func() {
gomega.Expect(content).To(gomega.ContainSubstring("Failed to decode the keys [\\\"foo\\\" \\\"containers.image_default_transport\\\"] from \\\"testdata/containers_broken.conf\\\""))
logrus.SetOutput(os.Stderr)
})

It("test default config errors", func() {
conf := Config{}
content := bytes.NewBufferString("")
logrus.SetOutput(content)
err := readConfigFromFile("containers.conf", &conf)
gomega.Expect(err).To(gomega.BeNil())
gomega.Expect(content.String()).To(gomega.Equal(""))
logrus.SetOutput(os.Stderr)
})
})

Describe("Reload", func() {
Expand Down
12 changes: 6 additions & 6 deletions pkg/config/containers.conf
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,12 @@ default_sysctls = [
# The network table contains settings pertaining to the management of
# CNI plugins.

[secrets]
# driver = "file"

[secrets.opts]
# root = "/example/directory"

[network]

# Path to directory where CNI plugin binaries are located.
Expand Down Expand Up @@ -503,9 +509,3 @@ default_sysctls = [
# TOML does not provide a way to end a table other than a further table being
# defined, so every key hereafter will be part of [volume_plugins] and not the
# main config.

[secret]
# driver = "file"

[secret.opts]
# root = "/example/directory"

0 comments on commit ca5f9ee

Please sign in to comment.