mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-26 15:32:30 +00:00
cache-factory: fix nil pointer runtime panic
For now, when we're using cache factory to launch kata containers, we would encounter nil pointer runtime panic. Fixes: #2272 Signed-off-by: Penny Zheng <penny.zheng@arm.com>
This commit is contained in:
parent
552e9407b8
commit
3d8ffe4120
@ -88,7 +88,7 @@ func (s *cacheServer) Quit(ctx context.Context, empty *types.Empty) (*types.Empt
|
|||||||
time.Sleep(time.Second)
|
time.Sleep(time.Second)
|
||||||
s.quit()
|
s.quit()
|
||||||
}()
|
}()
|
||||||
return nil, nil
|
return &types.Empty{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *cacheServer) Status(ctx context.Context, empty *types.Empty) (*pb.GrpcStatus, error) {
|
func (s *cacheServer) Status(ctx context.Context, empty *types.Empty) (*pb.GrpcStatus, error) {
|
||||||
|
@ -222,7 +222,7 @@ type agent interface {
|
|||||||
configure(h hypervisor, id, sharePath string, builtin bool, config interface{}) error
|
configure(h hypervisor, id, sharePath string, builtin bool, config interface{}) error
|
||||||
|
|
||||||
// configureFromGrpc will update agent settings based on provided arguments which from Grpc
|
// configureFromGrpc will update agent settings based on provided arguments which from Grpc
|
||||||
configureFromGrpc(id string, builtin bool, config interface{}) error
|
configureFromGrpc(h hypervisor, id string, builtin bool, config interface{}) error
|
||||||
|
|
||||||
// getVMPath will return the agent vm socket's directory path
|
// getVMPath will return the agent vm socket's directory path
|
||||||
getVMPath(id string) string
|
getVMPath(id string) string
|
||||||
|
@ -416,8 +416,8 @@ func (k *kataAgent) configure(h hypervisor, id, sharePath string, builtin bool,
|
|||||||
return h.addDevice(sharedVolume, fsDev)
|
return h.addDevice(sharedVolume, fsDev)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (k *kataAgent) configureFromGrpc(id string, builtin bool, config interface{}) error {
|
func (k *kataAgent) configureFromGrpc(h hypervisor, id string, builtin bool, config interface{}) error {
|
||||||
return k.internalConfigure(nil, id, "", builtin, config)
|
return k.internalConfigure(h, id, "", builtin, config)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (k *kataAgent) createSandbox(sandbox *Sandbox) error {
|
func (k *kataAgent) createSandbox(sandbox *Sandbox) error {
|
||||||
|
@ -181,7 +181,7 @@ func (n *noopAgent) configure(h hypervisor, id, sharePath string, builtin bool,
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (n *noopAgent) configureFromGrpc(id string, builtin bool, config interface{}) error {
|
func (n *noopAgent) configureFromGrpc(h hypervisor, id string, builtin bool, config interface{}) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -264,7 +264,7 @@ func NewVMFromGrpc(ctx context.Context, v *pb.GrpcVM, config VMConfig) (*VM, err
|
|||||||
}
|
}
|
||||||
|
|
||||||
agent := newAgent(config.AgentType)
|
agent := newAgent(config.AgentType)
|
||||||
agent.configureFromGrpc(v.Id, isProxyBuiltIn(config.ProxyType), config.AgentConfig)
|
agent.configureFromGrpc(hypervisor, v.Id, isProxyBuiltIn(config.ProxyType), config.AgentConfig)
|
||||||
|
|
||||||
proxy, err := newProxy(config.ProxyType)
|
proxy, err := newProxy(config.ProxyType)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user