Skip to content

Secure, Fast, and Extensible Sandbox runtime for AI agents.

chore: remove confirmed dead code across modules

贾岛46602e9ef366
diff --git a/components/egress/fastsandbox_server.go b/components/egress/fastsandbox_server.go
index f2e892f9a..31dee10bd 100644
--- a/components/egress/fastsandbox_server.go
+++ b/components/egress/fastsandbox_server.go
@@ -730,16 +730,6 @@ func (s *fastSandboxPolicyServer) attachment(subj subject.Subject) (actionhandle
return att, ok
}
-// storePendingPolicy holds the SET_BINDING policy of a still-denying subject
-// until its data-plane-ready Hook activates it. DNS dispatch keeps denying
-// while the policy is only pending (fail closed).
-func (s *fastSandboxPolicyServer) storePendingPolicy(subj subject.Subject, pol *policy.NetworkPolicy) {
- s.mu.Lock()
- defer s.mu.Unlock()
- s.pendingPolicies[subj] = pol
- log.Infof("subject %s: policy stored (deny-first until data-plane-ready)", subj)
-}
-
// clearPendingPolicy drops a subject's pending policy (binding removal or
// unload).
func (s *fastSandboxPolicyServer) clearPendingPolicy(subj subject.Subject) {
diff --git a/components/egress/mitmscripts/credential_bound.py b/components/egress/mitmscripts/credential_bound.py
index 98d180689..cf1b5c617 100644
--- a/components/egress/mitmscripts/credential_bound.py
+++ b/components/egress/mitmscripts/credential_bound.py
@@ -945,11 +945,5 @@ def configure(
return runtime, server
-def reset_for_tests() -> None:
- """Test-only: detach the module-level runtime without IPC cleanup."""
- global _runtime
- _runtime = None
-
-
def runtime() -> LiveRuntime | None:
return _runtime
diff --git a/components/egress/pkg/telemetry/meminfo_parse.go b/components/egress/pkg/telemetry/meminfo_parse.go
deleted file mode 100644
index 212714c8b..000000000
--- a/components/egress/pkg/telemetry/meminfo_parse.go
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright 2026 The OpenSandbox Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package telemetry
-
-import (
- "strconv"
- "strings"
-)
-
-// meminfoUsedBytesFromContent approximates used RAM from kB fields (MemTotal−MemAvailable preferred).
-func meminfoUsedBytesFromContent(data []byte) int64 {
- var memTotal, memAvail, memFree int64
- var haveT, haveA, haveF bool
- for _, line := range strings.Split(string(data), "\n") {
- line = strings.TrimSpace(line)
- switch {
- case strings.HasPrefix(line, "MemTotal:"):
- memTotal = meminfoFieldKB(line)
- haveT = memTotal > 0
- case strings.HasPrefix(line, "MemAvailable:"):
- memAvail = meminfoFieldKB(line)
- haveA = true
- case strings.HasPrefix(line, "MemFree:"):
- memFree = meminfoFieldKB(line)
- haveF = true
- }
- }
- if haveT && haveA && memTotal >= memAvail {
- return (memTotal - memAvail) * 1024
- }
- if haveT && haveF && memTotal >= memFree {
- return (memTotal - memFree) * 1024
- }
- return 0
-}
-
-func meminfoFieldKB(line string) int64 {
- fields := strings.Fields(line)
- if len(fields) < 2 {
- return 0
- }
- v, err := strconv.ParseInt(fields[1], 10, 64)
- if err != nil {
- return 0
- }
- return v
-}
diff --git a/components/egress/pkg/telemetry/meminfo_parse_test.go b/components/egress/pkg/telemetry/meminfo_parse_test.go
deleted file mode 100644
index 6ad42857e..000000000
--- a/components/egress/pkg/telemetry/meminfo_parse_test.go
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2026 The OpenSandbox Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package telemetry
-
-import (
- "testing"
-
- "github.com/stretchr/testify/assert"
-)
-
-func TestMeminfoUsedBytesFromContent(t *testing.T) {
- const sample = `MemTotal: 8000000 kB
-MemFree: 1000000 kB
-MemAvailable: 5000000 kB
-`
- // (8000000 - 5000000) * 1024
- assert.Equal(t, int64(3000000*1024), meminfoUsedBytesFromContent([]byte(sample)))
-
- fallback := `MemTotal: 8000000 kB
-MemFree: 1000000 kB
-`
- assert.Equal(t, int64(7000000*1024), meminfoUsedBytesFromContent([]byte(fallback)))
-}
diff --git a/components/egress/pkg/telemetry/procstat_parse.go b/components/egress/pkg/telemetry/procstat_parse.go
deleted file mode 100644
index 174279f1b..000000000
--- a/components/egress/pkg/telemetry/procstat_parse.go
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2026 The OpenSandbox Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package telemetry
-
-import (
- "strconv"
- "strings"
-)
-
-// procStatCPUJiffies parses the aggregate "cpu" line; idle counts idle+iowait (fields 4–5).
-func procStatCPUJiffies(line string) (total, idle uint64, ok bool) {
- fields := strings.Fields(line)
- if len(fields) < 5 || fields[0] != "cpu" {
- return 0, 0, false
- }
- var nums []uint64
- for i := 1; i < len(fields); i++ {
- v, err := strconv.ParseUint(fields[i], 10, 64)
- if err != nil {
- return 0, 0, false
- }
- nums = append(nums, v)
- }
- var sum uint64
- for _, v := range nums {
- sum += v
- }
- idle = nums[3]
- if len(nums) > 4 {
- idle += nums[4]
- }
- return sum, idle, true
-}
diff --git a/components/egress/pkg/telemetry/procstat_parse_test.go b/components/egress/pkg/telemetry/procstat_parse_test.go
deleted file mode 100644
index b88aa3b2b..000000000
--- a/components/egress/pkg/telemetry/procstat_parse_test.go
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright 2026 The OpenSandbox Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package telemetry
-
-import (
- "testing"
-
- "github.com/stretchr/testify/assert"
-)
-
-func TestProcStatCPUJiffies(t *testing.T) {
- // synthetic: user nice system idle iowait
- line := "cpu 100 0 50 200 25 0 0 0 0 0"
- total, idle, ok := procStatCPUJiffies(line)
- assert.True(t, ok)
- assert.Equal(t, uint64(375), total)
- assert.Equal(t, uint64(225), idle) // 200+25
-}
diff --git a/components/egress/tests/test_credential_bound_h2_runtime.py b/components/egress/tests/test_credential_bound_h2_runtime.py
index d67fd4b46..395c6cebc 100644
--- a/components/egress/tests/test_credential_bound_h2_runtime.py
+++ b/components/egress/tests/test_credential_bound_h2_runtime.py
@@ -1217,7 +1217,6 @@ def case_go_early_notice(harness, binary, required_version):
row = harness.wait_connection(lambda state: bool(state["active"]))
assert_attached(row)
old_stream = row["active"][0]["stream_id"]
- old_connection_serial = row["connection_serial"]
harness.install(2, None, retry=True)
harness.wait_connection(lambda state: state["fenced"] and state["frozen"] == old_stream)
diff --git a/components/egress/tests/test_credential_bound_h2_wakeup.py b/components/egress/tests/test_credential_bound_h2_wakeup.py
index a2bd403e6..f9e42721a 100644
--- a/components/egress/tests/test_credential_bound_h2_wakeup.py
+++ b/components/egress/tests/test_credential_bound_h2_wakeup.py
@@ -15,7 +15,7 @@ from credential_bound_h2 import BoundH2Server, dependency_versions_supported
from revision_receiver import Revision
from mitmproxy import connection, http
from mitmproxy.addons.proxyserver import Proxyserver
-from mitmproxy.proxy import commands, events, server, server_hooks
+from mitmproxy.proxy import commands, server, server_hooks
from mitmproxy.proxy.context import Context
from mitmproxy.proxy.layers import http as layers
import h2.config
diff --git a/components/execd/tests/runtime_init_smoke.py b/components/execd/tests/runtime_init_smoke.py
index ee7392294..2ae68bd4f 100644
--- a/components/execd/tests/runtime_init_smoke.py
+++ b/components/execd/tests/runtime_init_smoke.py
@@ -29,7 +29,6 @@ Prerequisites:
import hashlib
import json
import os
-import sys
import time
import uuid
diff --git a/components/ingress/pkg/proxy/wake_test.go b/components/ingress/pkg/proxy/wake_test.go
index 7c401557d..38ecbaaa2 100644
--- a/components/ingress/pkg/proxy/wake_test.go
+++ b/components/ingress/pkg/proxy/wake_test.go
@@ -94,12 +94,6 @@ func (f *fakeLifecycle) ResumeSandbox(context.Context, sandbox.EndpointTarget, s
return sandbox.ResumeAccepted, nil
}
-func (f *fakeLifecycle) resumeCount() int {
- f.mu.Lock()
- defer f.mu.Unlock()
- return f.resumes
-}
-
type recordingActivity struct {
mu sync.Mutex
entries []string
diff --git a/console/bff/app/routes/proxy_utils.py b/console/bff/app/routes/proxy_utils.py
index db8b37cc1..153bfc675 100644
--- a/console/bff/app/routes/proxy_utils.py
+++ b/console/bff/app/routes/proxy_utils.py
@@ -17,7 +17,6 @@ from __future__ import annotations
from typing import Any
import httpx
-from fastapi import HTTPException, status
from fastapi.responses import JSONResponse, Response
diff --git a/console/bff/app/session.py b/console/bff/app/session.py
index 04559e2bd..ba407d527 100644
--- a/console/bff/app/session.py
+++ b/console/bff/app/session.py
@@ -14,15 +14,12 @@
from __future__ import annotations
-import json
-from typing import Any, Literal
+from typing import Any
from itsdangerous import BadSignature, URLSafeTimedSerializer
from app.config import Settings
-Role = Literal["tenant", "admin"]
-
def _serializer(settings: Settings) -> URLSafeTimedSerializer:
return URLSafeTimedSerializer(settings.bff_session_secret, salt="opensandbox-console")
diff --git a/console/web/src/api/client.ts b/console/web/src/api/client.ts
index 88eda3d38..d015b0a63 100644
--- a/console/web/src/api/client.ts
+++ b/console/web/src/api/client.ts
@@ -111,10 +111,6 @@ export async function apiRequest<T>(
return body as T;
}
-export function isNotFound(err: unknown): boolean {
- return err instanceof ApiError && err.status === 404;
-}
-
export const authApi = {
me: () => apiRequest<SessionUser>('/api/auth/me'),
loginTenant: (apiKey: string) =>
diff --git a/console/web/src/api/types.ts b/console/web/src/api/types.ts
index 11c04f643..52e1a7e3b 100644
--- a/console/web/src/api/types.ts
+++ b/console/web/src/api/types.ts
@@ -166,8 +166,3 @@ export interface PlatformSummary {
sampleReasons?: string[];
}>;
}
-
-export interface ApiErrorBody {
- code?: string;
- message?: string;
-}
diff --git a/console/web/src/components/DismissibleAlert.tsx b/console/web/src/components/DismissibleAlert.tsx
deleted file mode 100644
index 9235792d3..000000000
--- a/console/web/src/components/DismissibleAlert.tsx
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright 2026 The OpenSandbox Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import { Alert, type AlertProps } from 'antd';
-import { useCallback, useState } from 'react';
-
-const STORAGE_PREFIX = 'opensandbox-console.dismiss-alert.';
-
-type Props = AlertProps & {
- /** Stable id; dismissal is remembered in localStorage for this browser. */
- dismissKey: string;
-};
-
-export function DismissibleAlert({ dismissKey, onClose, ...rest }: Props) {
- const storageKey = `${STORAGE_PREFIX}${dismissKey}`;
- const [hidden, setHidden] = useState(() => {
- try {
- return localStorage.getItem(storageKey) === '1';
- } catch {
- return false;
- }
- });
-
- const handleClose: NonNullable<AlertProps['onClose']> = useCallback(
- (e) => {
- try {
- localStorage.setItem(storageKey, '1');
- } catch {
- /* ignore quota / private mode */
- }
- setHidden(true);
- onClose?.(e);
- },
- [onClose, storageKey],
- );
-
- if (hidden) return null;
-
- return <Alert closable {...rest} onClose={handleClose} />;
-}
diff --git a/examples/aio-sandbox/main.py b/examples/aio-sandbox/main.py
index a6e4e645e..39b016b1e 100644
--- a/examples/aio-sandbox/main.py
+++ b/examples/aio-sandbox/main.py
@@ -50,8 +50,7 @@ def check_aio_process(sbx: SandboxSync) -> bool:
elapsed = time.perf_counter() - start
print(f"[check] sandbox ready after {elapsed:.1f}s")
return True
- except Exception as exc:
- # print(f"[check] aio sandbox check health failed: {exc}")
+ except Exception:
pass
time.sleep(0.2)
return False
diff --git a/examples/openclaw/main.py b/examples/openclaw/main.py
index 453fbd5b8..a8e70c208 100644
--- a/examples/openclaw/main.py
+++ b/examples/openclaw/main.py
@@ -54,7 +54,7 @@ def check_openclaw(sbx: SandboxSync, port: int = DEFAULT_PORT) -> bool:
elapsed = time.perf_counter() - start
print(f"[check] sandbox ready after {elapsed:.1f}s")
return True
- except Exception as exc:
+ except Exception:
pass
time.sleep(0.2)
return False
diff --git a/kubernetes/hack/pool-perf.py b/kubernetes/hack/pool-perf.py
index 431c755d1..d67864ae2 100755
--- a/kubernetes/hack/pool-perf.py
+++ b/kubernetes/hack/pool-perf.py
@@ -15,7 +15,6 @@
import asyncio
import time
import uuid
-import sys
import argparse
from kubernetes import client, config
from kubernetes.client.rest import ApiException
@@ -129,7 +128,7 @@ class PoolPerformanceTester:
print("{0}, endpoint {1}".format(name, bsb.get("metadata", {}).get("annotations", {}).get("sandbox.opensandbox.io/endpoints", "")))
self.results[name]["allocated_time"] = time.time() - start_polling
break
- except Exception as e:
+ except Exception:
pass
await asyncio.sleep(self.poll_interval)
@@ -179,12 +178,12 @@ class PoolPerformanceTester:
for name in self.bsb_names:
try:
self.custom_api.delete_namespaced_custom_object(GROUP, VERSION, NAMESPACE, BSB_PLURAL, name)
- except Exception as e:
+ except Exception:
# Silently ignore deletion errors during cleanup
pass
try:
self.custom_api.delete_namespaced_custom_object(GROUP, VERSION, NAMESPACE, POOL_PLURAL, self.pool_name)
- except Exception as e:
+ except Exception:
# Silently ignore deletion errors during cleanup
pass
@@ -226,4 +225,4 @@ if __name__ == "__main__":
except KeyboardInterrupt:
print("\nInterrupted by user")
finally:
- tester.cleanup()
\ No newline at end of file
+ tester.cleanup()
diff --git a/kubernetes/internal/controller/batchsandbox_controller_test.go b/kubernetes/internal/controller/batchsandbox_controller_test.go
index 371882f68..49d496632 100644
--- a/kubernetes/internal/controller/batchsandbox_controller_test.go
+++ b/kubernetes/internal/controller/batchsandbox_controller_test.go
@@ -22,7 +22,6 @@ import (
"net"
"reflect"
"strconv"
- "sync"
"testing"
"time"
@@ -624,10 +623,9 @@ func TestBatchSandboxReconciler_scheduleTasks(t *testing.T) {
}
)
type fields struct {
- Client client.Client
- Scheme *runtime.Scheme
- Recorder record.EventRecorder
- taskSchedulers sync.Map
+ Client client.Client
+ Scheme *runtime.Scheme
+ Recorder record.EventRecorder
}
type args struct {
ctx context.Context
diff --git a/sdks/code-interpreter/python/src/code_interpreter/adapters/code_adapter.py b/sdks/code-interpreter/python/src/code_interpreter/adapters/code_adapter.py
index c276f2426..7a83defd4 100644
--- a/sdks/code-interpreter/python/src/code_interpreter/adapters/code_adapter.py
+++ b/sdks/code-interpreter/python/src/code_interpreter/adapters/code_adapter.py
@@ -77,7 +77,6 @@ class CodesAdapter(Codes):
"""
RUN_CODE_PATH = "/code"
- CREATE_CONTEXT_PATH = "/code/context"
def __init__(
self, execd_endpoint: SandboxEndpoint, connection_config: ConnectionConfig
diff --git a/sdks/code-interpreter/python/src/code_interpreter/sync/adapters/code_adapter.py b/sdks/code-interpreter/python/src/code_interpreter/sync/adapters/code_adapter.py
index 1ec6eda24..068b2d444 100644
--- a/sdks/code-interpreter/python/src/code_interpreter/sync/adapters/code_adapter.py
+++ b/sdks/code-interpreter/python/src/code_interpreter/sync/adapters/code_adapter.py
@@ -80,7 +80,6 @@ class CodesAdapterSync(CodesSync):
"""
RUN_CODE_PATH = "/code"
- CREATE_CONTEXT_PATH = "/code/context"
def __init__(
self, execd_endpoint: SandboxEndpoint, connection_config: ConnectionConfigSync
diff --git a/sdks/sandbox/csharp/tests/OpenSandbox.Tests/CommandsAdapterTests.cs b/sdks/sandbox/csharp/tests/OpenSandbox.Tests/CommandsAdapterTests.cs
index 1621234ea..955a9372c 100644
--- a/sdks/sandbox/csharp/tests/OpenSandbox.Tests/CommandsAdapterTests.cs
+++ b/sdks/sandbox/csharp/tests/OpenSandbox.Tests/CommandsAdapterTests.cs
@@ -218,8 +218,6 @@ public class CommandsAdapterTests
}
}
- private static string QuoteForSh(string s) => "'" + s.Replace("'", "'\\''") + "'";
-
[Theory]
[InlineData("")]
[InlineData("1ABC")]
diff --git a/sdks/sandbox/csharp/tests/OpenSandbox.Tests/EgressAdapterNetworkPolicyTests.cs b/sdks/sandbox/csharp/tests/OpenSandbox.Tests/EgressAdapterNetworkPolicyTests.cs
index 4fa0b8ec9..e92d70ab2 100644
--- a/sdks/sandbox/csharp/tests/OpenSandbox.Tests/EgressAdapterNetworkPolicyTests.cs
+++ b/sdks/sandbox/csharp/tests/OpenSandbox.Tests/EgressAdapterNetworkPolicyTests.cs
@@ -80,18 +80,6 @@ public class EgressAdapterNetworkPolicyTests
}
""";
- private const string OkPolicyWithMalformedPort = """
- {
- "status": "ok",
- "policy": {
- "defaultAction": "deny",
- "egress": [
- { "action": "allow", "ports": ["https"] }
- ]
- }
- }
- """;
-
private const string OkPolicyWithEmptyPorts = """
{
"status": "ok",
diff --git a/sdks/sandbox/python/src/opensandbox/adapters/command_adapter.py b/sdks/sandbox/python/src/opensandbox/adapters/command_adapter.py
index d1fb9dbf1..8124edbc0 100644
--- a/sdks/sandbox/python/src/opensandbox/adapters/command_adapter.py
+++ b/sdks/sandbox/python/src/opensandbox/adapters/command_adapter.py
@@ -87,7 +87,6 @@ class CommandsAdapter(Commands):
"""
RUN_COMMAND_PATH = "/command"
- INTERRUPT_COMMAND_PATH = "/command/{execution_id}/interrupt"
SESSION_PATH = "/session"
RUN_IN_SESSION_PATH = "/session/{session_id}/run"
diff --git a/server/opensandbox_server/services/docker/docker_service.py b/server/opensandbox_server/services/docker/docker_service.py
index d161a94a0..df3879f84 100644
--- a/server/opensandbox_server/services/docker/docker_service.py
+++ b/server/opensandbox_server/services/docker/docker_service.py
@@ -197,7 +197,6 @@ class DockerSandboxService(DockerDiagnosticsMixin, DockerRuntimeMixin, DockerVol
self._lifecycle_locks_guard = Lock()
self._lifecycle_locks: WeakValueDictionary[str, LockType] = WeakValueDictionary()
self._execd_archive_lock = Lock()
- self._bootstrap_script_lock = Lock()
self._sandbox_expirations: Dict[str, datetime] = {}
self._expiration_timers: Dict[str, Timer] = {}
self._ossfs_mount_lock = Lock()
diff --git a/server/opensandbox_server/services/docker/runtime.py b/server/opensandbox_server/services/docker/runtime.py
index 02fb636b8..6d8137eda 100644
--- a/server/opensandbox_server/services/docker/runtime.py
+++ b/server/opensandbox_server/services/docker/runtime.py
@@ -46,7 +46,6 @@ SESSION_GATE_SOURCE_PATH = "/usr/local/libexec/opensandbox-session-gate"
SESSION_GATE_INSTALL_PATH = posixpath.join(OPENSANDBOX_DIR, "opensandbox-session-gate")
LAUNCHER_SOURCE_PATH = "/usr/local/libexec/opensandbox-launcher"
LAUNCHER_INSTALL_PATH = posixpath.join(OPENSANDBOX_DIR, "opensandbox-launcher")
-DEFAULT_EXECD_ENVS_PATH = posixpath.join(OPENSANDBOX_DIR, ".env")
class DockerRuntimeMixin:
diff --git a/server/opensandbox_server/services/k8s/client.py b/server/opensandbox_server/services/k8s/client.py
index d04605168..8bffc6654 100644
--- a/server/opensandbox_server/services/k8s/client.py
+++ b/server/opensandbox_server/services/k8s/client.py
@@ -23,7 +23,7 @@ from functools import partial
from typing import Callable, Any, Dict, List, Optional, Tuple
from kubernetes import client, config
-from kubernetes.client import ApiException, CoreV1Api, CustomObjectsApi, NodeV1Api, V1APIResourceList
+from kubernetes.client import ApiException, CoreV1Api, CustomObjectsApi, NodeV1Api
from opensandbox_server.config import KubernetesRuntimeConfig
from opensandbox_server.services.k8s.informer import WorkloadInformer
@@ -288,22 +288,6 @@ class K8sClient:
return []
raise
- def custom_resource_exists(self, group: str, version: str, plural: str) -> bool:
- """Distinguish an uninstalled API from a failed namespaced list."""
- if self._read_limiter:
- self._read_limiter.acquire()
- try:
- resources = self.get_custom_objects_api().get_api_resources(
- group, version, _request_timeout=(10, 30)
- )
- except ApiException as exc:
- if exc.status == 404:
- return False
- raise
- if not isinstance(resources, V1APIResourceList) or resources.resources is None:
- raise TypeError("API discovery returned an invalid APIResourceList response")
- return any(resource.name == plural for resource in resources.resources)
-
def invalidate_custom_objects(
self, group: str, version: str, plural: str, namespace: str
) -> None:
diff --git a/server/opensandbox_server/services/runtime_resolver.py b/server/opensandbox_server/services/runtime_resolver.py
index 3bf2cd41e..92f08729e 100644
--- a/server/opensandbox_server/services/runtime_resolver.py
+++ b/server/opensandbox_server/services/runtime_resolver.py
@@ -69,7 +69,6 @@ class SecureRuntimeResolver:
self.secure_runtime: Optional[SecureRuntimeConfig] = getattr(
config, "secure_runtime", None
)
- self.runtime_mode = config.runtime.type # "docker" or "kubernetes"
def is_enabled(self) -> bool:
"""Check if secure runtime is configured and enabled."""
diff --git a/tests/go/base_e2e_test.go b/tests/go/base_e2e_test.go
index 3d488214e..baa849792 100644
--- a/tests/go/base_e2e_test.go
+++ b/tests/go/base_e2e_test.go
@@ -323,13 +323,6 @@ func brokenConnectionConfig() opensandbox.ConnectionConfig {
}
}
-func newPoolManager(t *testing.T) *opensandbox.SandboxManager {
- t.Helper()
- mgr := opensandbox.NewSandboxManager(getConnectionConfig(t))
- t.Cleanup(func() { mgr.Close() })
- return mgr
-}
-
func snapshotIdle(pool *opensandbox.DefaultSandboxPool) int {
snap, err := pool.Snapshot(context.Background())
if err != nil {
diff --git a/tests/python/tests/test_isolated_session_e2e.py b/tests/python/tests/test_isolated_session_e2e.py
index 81ce9880c..462784775 100644
--- a/tests/python/tests/test_isolated_session_e2e.py
+++ b/tests/python/tests/test_isolated_session_e2e.py
@@ -675,7 +675,7 @@ class TestIsolatedSessionE2E:
workspace=IsolatedWorkspaceSpec(path="/tmp", mode="rw"),
)
async with self.sandbox.isolation.session(request) as session:
- r1 = await session.run("export CTX_VAR=hello123")
+ await session.run("export CTX_VAR=hello123")
r2 = await session.run("echo $CTX_VAR")
assert "hello123" in r2.text