coreos / coreos/coreos-assembler

kargs handling regressions?

Open
#2,430 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
393
Forks
193
Avg merge
17h 6m
Merged PRs (30d)
5

Description

Using quay.io/coreos-assembler/coreos-assembler:latest (maps to commit 350c1d93bc3343c8f523d642664bccd8dc0424c9), when I do coreos-assembler run --kargs foo=bar --kargs bar=foo, only the last karg is being appended to the kernel cmdline.

$ coreos-assembler run --kargs foo=bar --kargs bar=foo
COREOS_ASSEMBLER_CONTAINER_RUNTIME_ARGS=--name cosa-again
BASH_FUNC_coreos-assembler%%=() {  env | grep --color=auto COREOS_ASSEMBLER;
 chrt --idle 0 podman run --rm -ti --security-opt label=disable --privileged --uidmap=1000:0:1 --uidmap=0:1:1000 --uidmap 1001:1001:64536 -v ${PWD}:/srv/ --device /dev/kvm --device /dev/fuse --tmpfs /tmp -v /var/tmp:/var/tmp --name coreos-assembler ${COREOS_ASSEMBLER_CONFIG_GIT:+-v $COREOS_ASSEMBLER_CONFIG_GIT:/srv/;
+ chrt --idle 0 podman run --rm -ti --security-opt label=disable --privileged --uidmap=1000:0:1 --uidmap=0:1:1000 --uidmap 1001:1001:64536 -v /var/home/miabbott/openshift-os:/srv/ --device /dev/kvm --device /dev/fuse --tmpfs /tmp -v /var/tmp:/var/tmp --name coreos-assembler --name cosa-again quay.io/coreos-assemblero
[EVENT | QEMU guest is ready for SSH] [ [0;32m  OK   [0m] Started Network Manager Script Dispatcher Service.

Red Hat Enterprise Linux CoreOS 49.84.202109102026-0
  Part of OpenShift 4.9, RHCOS is a Kubernetes native operating system
  managed by the Machine Config Operator (`clusteroperator/machine-config`).

WARNING: Direct SSH access to machines is not recommended; instead,
make configuration changes via `machineconfig` objects:
  https://docs.openshift.com/container-platform/4.9/architecture/architecture-rhcos.html

---
Last login: Tue Sep 14 14:34:40 2021
[core@cosa-devsh ~]$ cat /proc/cmdline | more
BOOT_IMAGE=(hd0,gpt3)/ostree/rhcos-e0dce123559987d6a71c679e6357caebe104c0ed2778092a601fdf6c79f4dc0c/vmlinuz-4.18.0-305.17.1.el8_4.x86_64 random.trust_cpu=on console=tty0 console=ttyS0,115200n8 ignition.platform.id=qemu ignition.firstboot ostree=/ostree/boot.1/rhcos/e0dce123559987d6a71c679e6357caebe104c0ed2778092a601f
df6c79f4dc0c/0 bar=foo

Additionally, trying to combine multiple kargs into a single string causes cosa to choke:

$ coreos-assembler run --kargs "foo=bar bar=foo"
COREOS_ASSEMBLER_CONTAINER_RUNTIME_ARGS=--name cosa-again
BASH_FUNC_coreos-assembler%%=() {  env | grep --color=auto COREOS_ASSEMBLER;
 chrt --idle 0 podman run --rm -ti --security-opt label=disable --privileged --uidmap=1000:0:1 --uidmap=0:1:1000 --uidmap 1001:1001:64536 -v ${PWD}:/srv/ --device /dev/kvm --device /dev/fuse --tmpfs /tmp -v /var/tmp:/var/tmp --name coreos-assembler ${COREOS_ASSEMBLER_CONFIG_GIT:+-v $COREOS_ASSEMBLER_CONFIG_GIT:/srv/src/config/:ro} ${COREOS_ASSEMBLER_GIT:+-v $COREOS_ASSEMBLER_GIT/src/:/usr/lib/coreos-assembler/:ro} ${COREOS_ASSEMBLER_CONTAINER_RUNTIME_ARGS} ${COREOS_ASSEMBLER_CONTAINER:-quay.io/coreos-assembler/coreos-assembler:latest} $@;
+ chrt --idle 0 podman run --rm -ti --security-opt label=disable --privileged --uidmap=1000:0:1 --uidmap=0:1:1000 --uidmap 1001:1001:64536 -v /var/home/miabbott/openshift-os:/srv/ --device /dev/kvm --device /dev/fuse --tmpfs /tmp -v /var/tmp:/var/tmp --name coreos-assembler --name cosa-again quay.io/coreos-assembler/coreos-assembler:latest run --kargs foo=bar bar=foo
Error: Unhandled non-option argument passed for qemu: bar=foo
2021-09-14T14:35:39Z cli: Unhandled non-option argument passed for qemu: bar=foo
+ rc=1
+ set +x

These look like regressions based on the idea of the implementation here:

https://github.com/coreos/coreos-assembler/pull/1263#issuecomment-601426449

...and the actual implementation in https://github.com/coreos/coreos-assembler/pull/1265

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce both commands shown in the issue, then inspect the kargs implementation introduced by PR 1265 and the intended behavior discussed in PR 1263. Done means repeated --kargs flags preserve every argument and a quoted string containing multiple kargs is handled without treating later values as unrecognized qemu arguments.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.