mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-13 21:56:32 +00:00
Merge pull request #9881 from stevenhorsman/remote-hypervisor-policy
runtime: Support policy in remote hypervisor
This commit is contained in:
commit
d5b4da7331
@ -766,19 +766,21 @@ func (k *kataAgent) startSandbox(ctx context.Context, sandbox *Sandbox) error {
|
|||||||
|
|
||||||
if sandbox.config.HypervisorType == RemoteHypervisor {
|
if sandbox.config.HypervisorType == RemoteHypervisor {
|
||||||
ctx = context.WithValue(ctx, customRequestTimeoutKey, remoteRequestTimeout)
|
ctx = context.WithValue(ctx, customRequestTimeoutKey, remoteRequestTimeout)
|
||||||
} else {
|
}
|
||||||
// Check grpc server is serving
|
|
||||||
if err = k.check(ctx); err != nil {
|
// Check grpc server is serving
|
||||||
|
if err = k.check(ctx); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// If a Policy has been specified, send it to the agent.
|
||||||
|
if len(sandbox.config.AgentConfig.Policy) > 0 {
|
||||||
|
if err := sandbox.agent.setPolicy(ctx, sandbox.config.AgentConfig.Policy); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// If a Policy has been specified, send it to the agent.
|
if sandbox.config.HypervisorType != RemoteHypervisor {
|
||||||
if len(sandbox.config.AgentConfig.Policy) > 0 {
|
|
||||||
if err := sandbox.agent.setPolicy(ctx, sandbox.config.AgentConfig.Policy); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Setup network interfaces and routes
|
// Setup network interfaces and routes
|
||||||
interfaces, routes, neighs, err := generateVCNetworkStructures(ctx, sandbox.network)
|
interfaces, routes, neighs, err := generateVCNetworkStructures(ctx, sandbox.network)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user