Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove --verbose from rock entrypoint #495

Merged
2 changes: 1 addition & 1 deletion docs/reference/rockcraft.yaml.rst
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ others are optional.
**Required**: No

The optional name of the Pebble service to serve as the OCI entrypoint. If set,
this makes Rockcraft extend ``["/bin/pebble", "enter", "--verbose"]`` with
this makes Rockcraft extend ``["/bin/pebble", "enter"]`` with
``["--args", "<serviceName>"]``. The command of the Pebble service must
contain an optional argument that will become the OCI CMD.

Expand Down
7 changes: 1 addition & 6 deletions rockcraft/pebble.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,12 +260,7 @@ def get_entrypoint(build_base: str) -> list[str]:
# Previously pebble existed in /bin/pebble
pebble_path = Pebble.PEBBLE_BINARY_PATH_PREVIOUS

entrypoint = [f"/{pebble_path}", "enter"]

if is_legacy:
entrypoint += ["--verbose"]

return entrypoint
return [f"/{pebble_path}", "enter"]

@staticmethod
def _is_focal_or_jammy(build_base: str) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion tests/spread/foreign/big/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ execute: |
docker images

# Check the rock's output
docker run --rm big:latest | MATCH "/tmp"
docker run --rm big:latest --verbose | MATCH "/tmp"

############################################################################################
# test ownership: "newfiles" and "a.txt" are owned by uid 9999, "b.txt" is owned by uid 3333
Expand Down
4 changes: 2 additions & 2 deletions tests/spread/rockcraft/bare-base/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ execute: |
sudo rockcraft.skopeo --insecure-policy copy oci-archive:bare-base-test_latest_amd64.rock docker-daemon:bare-base-test:latest
rm bare-base-test_latest_amd64.rock
docker images bare-base-test:latest
id=$(docker run --rm -d bare-base-test)
id=$(docker run --rm -d bare-base-test --verbose)
grep_docker_log "$id" "ship it!"
docker exec "$id" pebble services | grep hello
docker exec "$id" pebble ls /usr/bin/hello
test "$(docker inspect "$id" -f '{{json .Config.Entrypoint}}')" = '["/bin/pebble","enter","--verbose"]'
test "$(docker inspect "$id" -f '{{json .Config.Entrypoint}}')" = '["/bin/pebble","enter"]'

docker rm -f "$id"
12 changes: 7 additions & 5 deletions tests/spread/rockcraft/entrypoint-service/task.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
summary: container entrypoint-service test

execute: |
set -ex
run_rockcraft pack

test -f entrypoint-service-test_latest_amd64.rock
Expand All @@ -10,11 +11,12 @@ execute: |
rm entrypoint-service-test_latest*.rock
docker images entrypoint-service-test:latest
id=$(docker run -d entrypoint-service-test)
test "$(docker inspect "$id" -f '{{json .Config.Entrypoint}}')" = '["/bin/pebble","enter","--verbose","--args","test-service"]'
test "$(docker inspect "$id" -f '{{json .Config.Entrypoint}}')" = '["/bin/pebble","enter","--args","test-service"]'
test "$(docker inspect "$id" -f '{{json .Config.Cmd}}')" = '["foo"]'
grep_docker_log "$id" "foo"
docker logs "$id" 2>&1 | grep "foo"
docker rm -f "$id"
id=$(docker run -d entrypoint-service-test bar)
test "$(docker inspect "$id" -f '{{json .Config.Cmd}}')" = '["bar"]'
grep_docker_log "$id" "bar"
id=$(sh -c 'docker run -d entrypoint-service-test bar \; --verbose')
test "$(docker inspect "$id" -f '{{json .Config.Entrypoint}}')" = '["/bin/pebble","enter","--args","test-service"]'
test "$(docker inspect "$id" -f '{{json .Config.Cmd}}')" = '["bar",";","--verbose"]'
docker logs "$id" 2>&1 | grep '\[test-service\] bar'
docker rm -f "$id"
4 changes: 2 additions & 2 deletions tests/unit/test_oci.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ def test_set_default_user(self, mock_run):
None,
"[email protected]",
Pebble.PEBBLE_BINARY_PATH_PREVIOUS,
["--config.entrypoint", "--verbose"],
[],
[],
),
(
Expand All @@ -583,7 +583,7 @@ def test_set_default_user(self, mock_run):
"test-service",
"[email protected]",
Pebble.PEBBLE_BINARY_PATH_PREVIOUS,
["--config.entrypoint", "--verbose"],
[],
[
"--config.entrypoint",
"--args",
Expand Down
Loading