Skip to content

parse: honor containers.conf seccomp_profile#6908

Open
jiwahn wants to merge 1 commit into
podman-container-tools:mainfrom
jiwahn:parse-seccomp-profile
Open

parse: honor containers.conf seccomp_profile#6908
jiwahn wants to merge 1 commit into
podman-container-tools:mainfrom
jiwahn:parse-seccomp-profile

Conversation

@jiwahn

@jiwahn jiwahn commented Jun 15, 2026

Copy link
Copy Markdown

What type of PR is this?

/kind bug

What this PR does / why we need it:

Buildah was already loading containers.conf, but it was not applying the SeccompProfile field to CommonBuildOptions. This patch wires that field into the existing security opt parsing path. If the user explicitly provides a CLI seccomp option, CLI values take precedence.

How to verify it

go test ./pkg/parse

I added a config parsing test that verifies:

  • seccomp_profile = "unconfined" from containers.conf is applied.
  • An explicit CLI --security-opt seccomp=... value takes precedence over the configured profile.
  • When no seccomp profile is configured, the existing default behavior is preserved.

Which issue(s) this PR fixes:

Fixes: #6498

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Buildah now honors containers.conf's seccomp_profile setting.

Fixes: podman-container-tools#6498
Signed-off-by: Jiwoo Ahn <ikwydls1314@gmail.com>

@nalind nalind left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good, one nit, nothing dramatic.

Comment thread pkg/parse/parse_test.go
func TestCommonBuildOptionsSeccompFromConfig(t *testing.T) {
configPath := filepath.Join(t.TempDir(), "containers.conf")
originalConfig, configWasSet := os.LookupEnv("CONTAINERS_CONF")
require.NoError(t, os.Setenv("CONTAINERS_CONF", configPath))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling t.Setenv("CONTAINERS_CONF", configPath) would probably narrow the cleanup block down to the config.Reload() call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

User containers.conf seccomp_profile = "unconfined" has no effect

2 participants