containers.conf: add new `compose_warnings_logs` option

Emit logs on each invocation of the compose command indicating that an
external compose provider is being executed.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
Valentin Rothberg 2023-07-18 10:38:27 +02:00
parent aa35cb9756
commit dc08c0598b
6 changed files with 31 additions and 0 deletions

View File

@ -428,6 +428,11 @@ Enforce using docker.io for completing short names in Podman's compatibility
REST API. Note that this will ignore unqualified-search-registries and
short-name aliases defined in containers-registries.conf(5).
**compose_warning_logs**=true
Emit logs on each invocation of the compose command indicating that an external
compose provider is being executed.
**conmon_env_vars**=[]
Environment variables to pass into Conmon.

View File

@ -266,6 +266,11 @@ type EngineConfig struct {
// in containers-registries.conf(5).
CompatAPIEnforceDockerHub bool `toml:"compat_api_enforce_docker_hub,omitempty"`
// ComposeWarningLogs emits logs on each invocation of the compose
// command indicating that an external compose provider is being
// executed.
ComposeWarningLogs bool `toml:"compose_warning_logs,omitempty"`
// DBBackend is the database backend to be used by Podman.
DBBackend string `toml:"database_backend,omitempty"`

View File

@ -476,6 +476,18 @@ var _ = Describe("Config Local", func() {
gomega.Expect(config2.Engine.CompatAPIEnforceDockerHub).To(gomega.Equal(false))
})
It("ComposeWarningLogs", func() {
// Given
config, err := NewConfig("")
gomega.Expect(err).To(gomega.BeNil())
gomega.Expect(config.Engine.ComposeWarningLogs).To(gomega.Equal(true))
// When
config2, err := NewConfig("testdata/containers_default.conf")
// Then
gomega.Expect(err).To(gomega.BeNil())
gomega.Expect(config2.Engine.ComposeWarningLogs).To(gomega.Equal(false))
})
It("Set machine disk", func() {
// Given
config, err := NewConfig("")

View File

@ -381,6 +381,10 @@ default_sysctls = [
# short-name aliases defined in containers-registries.conf(5).
#compat_api_enforce_docker_hub = true
# Emit logs on each invocation of the compose command indicating that an
# external compose provider is being executed.
#compose_warning_logs = true
# The compression format to use when pushing an image.
# Valid options are: `gzip`, `zstd` and `zstd:chunked`.
#

View File

@ -260,6 +260,7 @@ func defaultConfigFromMemory() (*EngineConfig, error) {
c.EventsLogFileMaxSize = eventsLogMaxSize(DefaultEventsLogSizeMax)
c.CompatAPIEnforceDockerHub = true
c.ComposeWarningLogs = true
if path, ok := os.LookupEnv("CONTAINERS_STORAGE_CONF"); ok {
if err := types.SetDefaultConfigFilePath(path); err != nil {

View File

@ -162,6 +162,10 @@ conmon_path = [
# short-name aliases defined in containers-registries.conf(5).
compat_api_enforce_docker_hub = false
# Emit logs on each invocation of the compose command indicating that an
# external compose provider is being executed.
compose_warning_logs = false
# Environment variables to be used when running the container engine (e.g., Podman, Buildah).
# For example "http_proxy=internal.proxy.company.com".
# Note these environment variables will not be used within the container.