containers / containers/podman-compose

security_opt allows value without a dash

Open Beginner friendly
#1,444 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
6.2k
Forks
622
PR merge metrics
No merged PRs in 30d

Description

[`security_opt`](https://github.com/compose-spec/compose-spec/blob/main/spec.md#security_opt) element should accept a list (array?):
```yml
security_opt:
- label:user:USER
- label:role:ROLE
```
At least for a single value, the dash is not enforced here, so following syntax is possible for podman-compose:
```yml
security_opt:
label=disable
```
Docker-compose doesn't allow that:
```console
$ docker compose up
validating docker-compose.yml: services..security_opt must be a array
```
Following syntax works there:
```yml
security_opt:
- label=disable
```
```console
$ podman-compose version
podman-compose version 1.5.0
podman version 5.8.2
```
**Environment:**
- OS: Linux

Contributor guide

Open the contributing guide

Research direction

Start by locating the security_opt validation or parsing entry point in podman-compose and compare its handling of a scalar value with the array syntax shown in the issue. Done means a scalar such as label=disable is rejected while the list form is accepted, with regression coverage for both cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker-compose, python
Domain
devops
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.