File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -131,13 +131,15 @@ def test_snap_wrapper_uses_optional_gateway_config_without_generating_toml() ->
131131 assert 'exec "${SNAP}/bin/openshell-gateway" "$@"' in wrapper
132132
133133
134- def test_snap_docker_connect_hook_restarts_gateway () -> None :
134+ def test_snap_docker_connect_hook_enables_and_starts_gateway () -> None :
135135 repo_root = Path (__file__ ).resolve ().parents [2 ]
136136 hook = repo_root / "snap/hooks/connect-plug-docker"
137+ snapcraft = (repo_root / "snapcraft.yaml" ).read_text (encoding = "utf-8" )
137138
138139 assert hook .is_file ()
139140 assert hook .stat ().st_mode & stat .S_IXUSR
140- assert 'snapctl restart "${SNAP_INSTANCE_NAME}.gateway"' in hook .read_text (
141+ assert "install-mode: disable" in snapcraft
142+ assert 'snapctl start --enable "${SNAP_INSTANCE_NAME}.gateway"' in hook .read_text (
141143 encoding = "utf-8"
142144 )
143145
Original file line number Diff line number Diff line change 22# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33# SPDX-License-Identifier: Apache-2.0
44
5- # The gateway daemon can start when this plug is still disconnected. Restart it
6- # after Docker access becomes available so driver auto-detection runs with the
7- # socket exposed by docker:docker-daemon. This hook does not make normal gateway
8- # startup conditional on Docker; it runs only after an operator connects Docker.
5+ # The gateway is disabled on installation so it cannot start before this plug is
6+ # connected. Enable and start it after Docker access becomes available so driver
7+ # auto-detection runs with the socket exposed by docker:docker-daemon.
98
109set -eu
1110
12- snapctl restart " ${SNAP_INSTANCE_NAME} .gateway"
11+ snapctl start --enable " ${SNAP_INSTANCE_NAME} .gateway"
Original file line number Diff line number Diff line change 8282 gateway :
8383 command : bin/openshell-gateway-wrapper
8484 daemon : simple
85+ # Do not start before the Docker interface is available. The
86+ # connect-plug-docker hook enables and starts the gateway after Docker
87+ # access is granted, including for store-managed auto-connections.
88+ install-mode : disable
8589 # refresh-mode: endure prevents snapd from restarting the gateway daemon
8690 # during snap refreshes, which would kill active sandbox sessions.
8791 # Operators must manually restart the service after a refresh if needed.
You can’t perform that action at this time.
0 commit comments