Documentation
¶
Index ¶
Constants ¶
const DBBucketNetwork = "network/v1"
Variables ¶
var (
ErrInvalidParams = errors.New("invalid network params")
)
var ErrSandboxNetworkNotActive = networkruntime.ErrNetworkNotActive
ErrSandboxNetworkNotActive reports that the sandbox has no active network, so its policy cannot be updated. Callers map it to a client-visible conflict rather than an internal failure.
Functions ¶
func GetTapFileForShim ¶
GetTapFileForShim obtains a one-shot TAP file from the runtime. The caller owns the returned file and must close it after passing it via SCM_RIGHTS.
func IsSandboxNetworkNotActive ¶
IsSandboxNetworkNotActive reports whether err means the sandbox has no active network, which is a caller mistake (wrong or stopped sandbox) rather than a node-side failure.
func UpdateSandboxNetworkPolicy ¶
func UpdateSandboxNetworkPolicy(ctx context.Context, sandboxID string, cfg *cubebox.CubeNetworkConfig) error
UpdateSandboxNetworkPolicy replaces a running sandbox's egress policy.
cfg is the complete desired state as authored by the user; the runtime folds the sandbox's DNS resolver CIDRs back in, so callers pass exactly what the API received.
Types ¶
type Config ¶
type Config struct {
EthName string `toml:"eth_name"`
TapInitNum int `toml:"tap_init_num"`
CIDR string `toml:"cidr"`
ObjectDir string `toml:"object_dir"`
MVMInnerIP string `toml:"mvm_inner_ip"`
MVMMacAddr string `toml:"mvm_mac_addr"`
MvmGwDestIP string `toml:"mvm_gw_dest_ip"`
MvmGwMacAddr string `toml:"mvm_gw_mac_addr"`
MvmMask int `toml:"mvm_mask"`
MvmMtu int `toml:"mvm_mtu"`
CheckIntervalTime tomlext.Duration `toml:"check_interval_in_sec"`
ReportStatIntervalTime tomlext.Duration `toml:"report_stat_interval_in_sec"`
AppMark string `toml:"app_mark"`
WatchStream bool `toml:"watch_stream"`
RedisConfPath string `toml:"redis_conf_path"`
StreamNamePrefix string `toml:"stream_name_prefix"`
StreamKey string `toml:"stream_key"`
StreamBlockTime tomlext.Duration `toml:"stream_block_time"`
RootPath string `toml:"root_path"`
CubeEgressAdminURL string `toml:"cube_egress_admin_url"`
CubeEgressPushTimeout tomlext.Duration `toml:"cube_egress_push_timeout"`
CubeRouterEnable bool `toml:"cube_router_enable"`
CubeRouterCIDR string `toml:"cube_router_cidr"`
CubeRouterMacAddr string `toml:"cube_router_mac_addr"`
}