diff --git a/docs/reference/rockcraft.yaml.rst b/docs/reference/rockcraft.yaml.rst index 9a7fe0ddb..fa0156927 100644 --- a/docs/reference/rockcraft.yaml.rst +++ b/docs/reference/rockcraft.yaml.rst @@ -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", ""]``. The command of the Pebble service must contain an optional argument that will become the OCI CMD. diff --git a/rockcraft/pebble.py b/rockcraft/pebble.py index 0e1080696..788762583 100644 --- a/rockcraft/pebble.py +++ b/rockcraft/pebble.py @@ -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: diff --git a/tests/spread/foreign/big/task.yaml b/tests/spread/foreign/big/task.yaml index 660046d8d..5171d0f9b 100644 --- a/tests/spread/foreign/big/task.yaml +++ b/tests/spread/foreign/big/task.yaml @@ -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 diff --git a/tests/spread/rockcraft/bare-base/task.yaml b/tests/spread/rockcraft/bare-base/task.yaml index 9957b0c54..76238af21 100644 --- a/tests/spread/rockcraft/bare-base/task.yaml +++ b/tests/spread/rockcraft/bare-base/task.yaml @@ -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" diff --git a/tests/spread/rockcraft/entrypoint-service/task.yaml b/tests/spread/rockcraft/entrypoint-service/task.yaml index 3e26e11e3..d86273557 100644 --- a/tests/spread/rockcraft/entrypoint-service/task.yaml +++ b/tests/spread/rockcraft/entrypoint-service/task.yaml @@ -1,6 +1,7 @@ summary: container entrypoint-service test execute: | + set -ex run_rockcraft pack test -f entrypoint-service-test_latest_amd64.rock @@ -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" diff --git a/tests/unit/test_oci.py b/tests/unit/test_oci.py index 72e0429cf..a9139bf0e 100644 --- a/tests/unit/test_oci.py +++ b/tests/unit/test_oci.py @@ -569,7 +569,7 @@ def test_set_default_user(self, mock_run): None, "ubuntu@22.04", Pebble.PEBBLE_BINARY_PATH_PREVIOUS, - ["--config.entrypoint", "--verbose"], + [], [], ), ( @@ -583,7 +583,7 @@ def test_set_default_user(self, mock_run): "test-service", "ubuntu@22.04", Pebble.PEBBLE_BINARY_PATH_PREVIOUS, - ["--config.entrypoint", "--verbose"], + [], [ "--config.entrypoint", "--args",