Skip to content

Commit 24d7820

Browse files
Merge pull request containers#1243 from vrothberg/RUN-1702
containers.conf: add events_container_create_inspect_data
2 parents db0d935 + fbb0de7 commit 24d7820

File tree

5 files changed

+17
-0
lines changed

5 files changed

+17
-0
lines changed

docs/containers.conf.5.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,11 @@ use this command:
446446

447447
Valid values are: `file`, `journald`, and `none`.
448448

449+
**events_container_create_inspect_data**=true|false
450+
451+
Creates a more verbose container-create event which includes a JSON payload
452+
with detailed information about the container. Set to false by default.
453+
449454
**helper_binaries_dir**=["/usr/libexec/podman", ...]
450455

451456
A is a list of directories which are used to search for helper binaries.

pkg/config/config.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,11 @@ type EngineConfig struct {
273273
// EventsLogger determines where events should be logged.
274274
EventsLogger string `toml:"events_logger,omitempty"`
275275

276+
// EventsContainerCreateInspectData creates a more verbose
277+
// container-create event which includes a JSON payload with detailed
278+
// information about the container.
279+
EventsContainerCreateInspectData bool `toml:"events_container_create_inspect_data,omitempty"`
280+
276281
// graphRoot internal stores the location of the graphroot
277282
graphRoot string
278283

pkg/config/config_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ var _ = Describe("Config", func() {
3535
gomega.Expect(defaultConfig.Engine.InfraImage).To(gomega.BeEquivalentTo(""))
3636
gomega.Expect(defaultConfig.Engine.ImageVolumeMode).To(gomega.BeEquivalentTo("bind"))
3737
gomega.Expect(defaultConfig.Engine.SSHConfig).To(gomega.ContainSubstring("/.ssh/config"))
38+
gomega.Expect(defaultConfig.Engine.EventsContainerCreateInspectData).To(gomega.BeFalse())
3839
path, err := defaultConfig.ImageCopyTmpDir()
3940
gomega.Expect(err).To(gomega.BeNil())
4041
gomega.Expect(path).To(gomega.BeEquivalentTo("/var/tmp"))
@@ -446,6 +447,7 @@ image_copy_tmp_dir="storage"`
446447
gomega.Expect(config.Engine.PlatformToOCIRuntime).To(gomega.Equal(PlatformToOCIRuntimeMap))
447448
gomega.Expect(config.Engine.ImageDefaultFormat).To(gomega.Equal("v2s2"))
448449
gomega.Expect(config.Engine.EventsLogFilePath).To(gomega.BeEquivalentTo("/tmp/events.log"))
450+
gomega.Expect(config.Engine.EventsContainerCreateInspectData).To(gomega.BeTrue())
449451
path, err := config.ImageCopyTmpDir()
450452
gomega.Expect(err).To(gomega.BeNil())
451453
gomega.Expect(path).To(gomega.BeEquivalentTo("/tmp/foobar"))

pkg/config/containers.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,10 @@ default_sysctls = [
410410
#
411411
#events_logger = "journald"
412412

413+
# Creates a more verbose container-create event which includes a JSON payload
414+
# with detailed information about the container.
415+
#events_container_create_inspect_data = false
416+
413417
# A is a list of directories which are used to search for helper binaries.
414418
#
415419
#helper_binaries_dir = [

pkg/config/testdata/containers_override.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ image_default_format="v2s2"
1111
image_copy_tmp_dir="/tmp/foobar"
1212
events_logfile_path = "/tmp/events.log"
1313
events_logfile_max_size="500"
14+
events_container_create_inspect_data = true
1415
pod_exit_policy="stop"
1516

1617
[engine.platform_to_oci_runtime]

0 commit comments

Comments
 (0)