Merge pull request #16299 from alexlarsson/quadlet-shortname-warning

quadlet: Warn in generator if using short names
This commit is contained in:
OpenShift Merge Robot
2022-11-18 20:01:39 +00:00
committed by GitHub
29 changed files with 150 additions and 36 deletions

View File

@@ -1,11 +1,11 @@
## assert-podman-final-args imagename
## assert-podman-final-args localhost/imagename
## assert-podman-args "--annotation" "org.foo.Arg0=arg0"
## assert-podman-args "--annotation" "org.foo.Arg1=arg1"
## assert-podman-args "--annotation" "org.foo.Arg2=arg 2"
## assert-podman-args "--annotation" "org.foo.Arg3=arg3"
[Container]
Image=imagename
Image=localhost/imagename
Annotation=org.foo.Arg1=arg1 "org.foo.Arg2=arg 2" \
org.foo.Arg3=arg3

View File

@@ -1,7 +1,7 @@
## assert-podman-final-args run --name=systemd-%N --cidfile=%t/%N.cid --replace --rm -d --log-driver passthrough --pull=never --runtime /usr/bin/crun --cgroups=split --sdnotify=conmon imagename
## assert-podman-final-args run --name=systemd-%N --cidfile=%t/%N.cid --replace --rm -d --log-driver passthrough --pull=never --runtime /usr/bin/crun --cgroups=split --sdnotify=conmon localhost/imagename
[Container]
Image=imagename
Image=localhost/imagename
# Disable all default features to get as empty podman run command as we can
ReadOnly=no

View File

@@ -1,4 +1,4 @@
## assert-podman-final-args imagename
## assert-podman-final-args localhost/imagename
## assert-podman-args "--name=systemd-%N"
## assert-podman-args "--cidfile=%t/%N.cid"
## assert-podman-args "--rm"
@@ -25,4 +25,4 @@
## assert-key-is "Service" "Environment" "PODMAN_SYSTEMD_UNIT=%n"
[Container]
Image=imagename
Image=localhost/imagename

View File

@@ -4,7 +4,7 @@
## assert-podman-args "--cap-add=cap_ipc_owner"
[Container]
Image=imagename
Image=localhost/imagename
# Verify that we can reset to the default cap set
DropCapability=
AddCapability=CAP_DAC_OVERRIDE CAP_AUDIT_WRITE

View File

@@ -1,4 +1,4 @@
## assert-podman-final-args imagename
## assert-podman-final-args localhost/imagename
## assert-podman-args --env "FOO1=foo1"
## assert-podman-args --env "FOO2=foo2 "
## assert-podman-args --env "FOO3=foo3"
@@ -6,7 +6,7 @@
## assert-podman-args --env "FOO4=foo\\nfoo"
[Container]
Image=imagename
Image=localhost/imagename
Environment=FOO1=foo1 "FOO2=foo2 " \
FOO3=foo3 REPLACE=replace
Environment=REPLACE=replaced 'FOO4=foo\nfoo'

View File

@@ -1,5 +1,5 @@
## assert-podman-final-args "/some/path" "an arg" "a;b\\nc\\td'e" "a;b\\nc\\td" "a\"b"
[Container]
Image=imagename
Image=localhost/imagename
Exec=/some/path "an arg" "a;b\nc\td'e" a;b\nc\td 'a"b'

View File

@@ -1,6 +1,6 @@
## assert-podman-final-args imagename "/some/binary file" "--arg1" "arg 2"
## assert-podman-final-args localhost/imagename "/some/binary file" "--arg1" "arg 2"
[Container]
Image=imagename
Image=localhost/imagename
Exec="/some/binary file" --arg1 \
"arg 2"

View File

@@ -1,4 +1,4 @@
## assert-podman-final-args imagename
## assert-podman-final-args localhost/imagename
[Container]
Image=imagename
Image=localhost/imagename

View File

@@ -9,7 +9,7 @@
## assert-symlink req3.service.requires/install.service ../install.service
[Container]
Image=imagename
Image=localhost/imagename
[Install]
Alias=alias.service \

View File

@@ -1,11 +1,11 @@
## assert-podman-final-args imagename
## assert-podman-final-args localhost/imagename
## assert-podman-args "--label" "org.foo.Arg0=arg0"
## assert-podman-args "--label" "org.foo.Arg1=arg1"
## assert-podman-args "--label" "org.foo.Arg2=arg 2"
## assert-podman-args "--label" "org.foo.Arg3=arg3"
[Container]
Image=imagename
Image=localhost/imagename
Label=org.foo.Arg1=arg1 "org.foo.Arg2=arg 2" \
org.foo.Arg3=arg3

View File

@@ -1,5 +1,5 @@
## assert-podman-args "--name=foobar"
[Container]
Image=imagename
Image=localhost/imagename
ContainerName=foobar

View File

@@ -2,5 +2,5 @@
## !assert-podman-args --gidmap
[Container]
Image=imagename
Image=localhost/imagename
RemapUsers=no

View File

@@ -20,7 +20,7 @@
## assert-podman-args --gidmap 1002:1002:4294966293
[Container]
Image=imagename
Image=localhost/imagename
RemapUsers=no
User=1000
Group=1001

View File

@@ -1,5 +1,5 @@
## assert-podman-args "--sdnotify=container"
[Container]
Image=imagename
Image=localhost/imagename
Notify=yes

View File

@@ -1,10 +1,10 @@
## assert-podman-final-args imagename
## assert-podman-final-args localhost/imagename
## assert-key-is "Unit" "Foo" "bar1" "bar2"
## assert-key-is "X-Container" "Image" "imagename"
## assert-key-is "X-Container" "Image" "localhost/imagename"
[Unit]
Foo=bar1
Foo=bar2
[Container]
Image=imagename
Image=localhost/imagename

View File

@@ -3,7 +3,7 @@
## assert-podman-args "--also"
[Container]
Image=imagename
Image=localhost/imagename
PodmanArgs="--foo" \
--bar
PodmanArgs=--also

View File

@@ -1,5 +1,5 @@
[Container]
Image=imagename
Image=localhost/imagename
## assert-podman-args --expose=1000
ExposeHostPort=1000
## assert-podman-args --expose=2000-3000

View File

@@ -1,5 +1,5 @@
[Container]
Image=imagename
Image=localhost/imagename
## assert-podman-args -p=[::1]:80:90
PublishPort=[::1]:80:90

View File

@@ -0,0 +1,4 @@
## assert-stderr-contains "not a fully qualified image name"
[Container]
Image=shortname

View File

@@ -5,5 +5,5 @@
## assert-key-is "Service" "NotifyAccess" "all"
[Container]
Image=imagename
Image=localhost/imagename
SocketActivated=yes

View File

@@ -1,5 +1,5 @@
## assert-podman-args --tz=foo
[Container]
Image=imagename
Image=localhost/imagename
Timezone=foo

View File

@@ -11,7 +11,7 @@
## assert-podman-args --gidmap 1002:101000:99000
[Container]
Image=imagename
Image=localhost/imagename
User=1000
HostUser=900
Group=1001

View File

@@ -14,7 +14,7 @@
# This means container root must map to something else
[Container]
Image=imagename
Image=localhost/imagename
User=1000
# Also test name parsing
HostUser=root

View File

@@ -10,7 +10,7 @@
# Map container uid root to host root
[Container]
Image=imagename
Image=localhost/imagename
User=0
# Also test name parsing
HostUser=root

View File

@@ -1,7 +1,7 @@
## assert-podman-final-args imagename
## assert-podman-final-args localhost/imagename
## assert-podman-args "--user" "998:999"
[Container]
Image=imagename
Image=localhost/imagename
User=998
Group=999

View File

@@ -1,10 +1,10 @@
## assert-podman-args -v /host/dir:/container/volume
## assert-podman-args -v /host/dir2:/container/volume2:Z
## assert-podman-args -v named:/container/named
## assert-podman-args -v systemd-quadlet:/container/quadlet imagename
## assert-podman-args -v systemd-quadlet:/container/quadlet localhost/imagename
[Container]
Image=imagename
Image=localhost/imagename
Volume=/host/dir:/container/volume
Volume=/host/dir2:/container/volume2:Z
Volume=/container/empty

View File

@@ -291,6 +291,7 @@ var _ = Describe("quadlet system generator", func() {
Entry("readwrite.container", "readwrite.container"),
Entry("readwrite-notmpfs.container", "readwrite-notmpfs.container"),
Entry("seccomp.container", "seccomp.container"),
Entry("shortname.container", "shortname.container"),
Entry("timezone.container", "timezone.container"),
Entry("user.container", "user.container"),
Entry("user-host.container", "user-host.container"),