Class InClusterStrategy
java.lang.Object
io.agentscope.extensions.sandbox.kubernetes.client.internal.strategy.InClusterStrategy
- All Implemented Interfaces:
ConnectionStrategy
Direct in-cluster connectivity to a sandbox pod, bypassing the router.
Does not inject
X-Sandbox-* headers.-
Constructor Summary
ConstructorsConstructorDescriptionInClusterStrategy(String sandboxId, String namespace, InClusterConnectionConfig config, Supplier<String> podIpSupplier) -
Method Summary
-
Constructor Details
-
InClusterStrategy
public InClusterStrategy(String sandboxId, String namespace, InClusterConnectionConfig config, Supplier<String> podIpSupplier)
-
-
Method Details
-
connect
Description copied from interface:ConnectionStrategyDiscover and return the base URL.- Specified by:
connectin interfaceConnectionStrategy- Returns:
- the base URL (e.g.
http://127.0.0.1:12345)
-
close
public void close()Description copied from interface:ConnectionStrategyRelease any resources held by this strategy (e.g. port-forward tunnels).- Specified by:
closein interfaceConnectionStrategy
-
shouldInjectRouterHeaders
public boolean shouldInjectRouterHeaders()Description copied from interface:ConnectionStrategyWhetherX-Sandbox-*router headers should be injected into requests.- Specified by:
shouldInjectRouterHeadersin interfaceConnectionStrategy- Returns:
- true for router-based strategies; false for in-cluster direct
-