Skip to content

Commit f4e4767

Browse files
committed
pkg/util: Add endpoints to redirector
- Add UpdateEphemeralMounts and RemoveStaleVirtiofsShareMounts to redirector, proxy_test and shim_test to stay compatible with kata-agent protos Signed-off-by: stevenhorsman <[email protected]>
1 parent 478f9b5 commit f4e4767

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

pkg/adaptor/proxy/proxy_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,9 @@ func (m *agentMock) WaitProcess(ctx context.Context, req *pb.WaitProcessRequest)
283283
func (m *agentMock) UpdateContainer(ctx context.Context, req *pb.UpdateContainerRequest) (*types.Empty, error) {
284284
return &types.Empty{}, nil
285285
}
286+
func (m *agentMock) UpdateEphemeralMounts(ctx context.Context, req *pb.UpdateEphemeralMountsRequest) (*types.Empty, error) {
287+
return &types.Empty{}, nil
288+
}
286289
func (m *agentMock) StatsContainer(ctx context.Context, req *pb.StatsContainerRequest) (*pb.StatsContainerResponse, error) {
287290
return &pb.StatsContainerResponse{}, nil
288291
}
@@ -367,6 +370,9 @@ func (m *agentMock) GetVolumeStats(ctx context.Context, req *pb.VolumeStatsReque
367370
func (m *agentMock) ResizeVolume(ctx context.Context, req *pb.ResizeVolumeRequest) (*types.Empty, error) {
368371
return &types.Empty{}, nil
369372
}
373+
func (p *agentMock) RemoveStaleVirtiofsShareMounts(ctx context.Context, req *pb.RemoveStaleVirtiofsShareMountsRequest) (*types.Empty, error) {
374+
return &types.Empty{}, nil
375+
}
370376
func (m *agentMock) PullImage(ctx context.Context, req *pb.PullImageRequest) (*pb.PullImageResponse, error) {
371377
return &pb.PullImageResponse{}, nil
372378
}

pkg/adaptor/shim_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,10 @@ func (s *agentService) UpdateContainer(ctx context.Context, req *agent.UpdateCon
364364
log.Printf("agent call: %T %#v", req, req)
365365
return &types.Empty{}, nil
366366
}
367+
func (s *agentService) UpdateEphemeralMounts(ctx context.Context, req *agent.UpdateEphemeralMountsRequest) (*types.Empty, error) {
368+
log.Printf("agent call: %T %#v", req, req)
369+
return &types.Empty{}, nil
370+
}
367371
func (s *agentService) StatsContainer(ctx context.Context, req *agent.StatsContainerRequest) (*agent.StatsContainerResponse, error) {
368372
log.Printf("agent call: %T %#v", req, req)
369373
return &agent.StatsContainerResponse{}, nil
@@ -507,6 +511,10 @@ func (s *agentService) ResizeVolume(ctx context.Context, req *agent.ResizeVolume
507511
log.Printf("agent call: %T %#v", req, req)
508512
return &types.Empty{}, nil
509513
}
514+
func (s *agentService) RemoveStaleVirtiofsShareMounts(ctx context.Context, req *agent.RemoveStaleVirtiofsShareMountsRequest) (*types.Empty, error) {
515+
log.Printf("agent call: %T %#v", req, req)
516+
return &types.Empty{}, nil
517+
}
510518
func (s *agentService) PullImage(ctx context.Context, req *agent.PullImageRequest) (*types.Empty, error) {
511519
log.Printf("agent call: PullImage %#v", req)
512520
return &types.Empty{}, nil

pkg/util/agentproto/redirector.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,14 @@ func (s *redirector) UpdateContainer(ctx context.Context, req *pb.UpdateContaine
144144
return s.agentClient.UpdateContainer(ctx, req)
145145
}
146146

147+
func (s *redirector) UpdateEphemeralMounts(ctx context.Context, req *pb.UpdateEphemeralMountsRequest) (res *types.Empty, err error) {
148+
149+
if err := s.Connect(ctx); err != nil {
150+
return nil, err
151+
}
152+
return s.agentClient.UpdateEphemeralMounts(ctx, req)
153+
}
154+
147155
func (s *redirector) StatsContainer(ctx context.Context, req *pb.StatsContainerRequest) (res *pb.StatsContainerResponse, err error) {
148156

149157
if err := s.Connect(ctx); err != nil {
@@ -168,6 +176,13 @@ func (s *redirector) ResumeContainer(ctx context.Context, req *pb.ResumeContaine
168176
return s.agentClient.ResumeContainer(ctx, req)
169177
}
170178

179+
func (s *redirector) RemoveStaleVirtiofsShareMounts(ctx context.Context, req *pb.RemoveStaleVirtiofsShareMountsRequest) (res *types.Empty, err error) {
180+
if err := s.Connect(ctx); err != nil {
181+
return nil, err
182+
}
183+
return s.agentClient.RemoveStaleVirtiofsShareMounts(ctx, req)
184+
}
185+
171186
func (s *redirector) WriteStdin(ctx context.Context, req *pb.WriteStreamRequest) (res *pb.WriteStreamResponse, err error) {
172187

173188
if err := s.Connect(ctx); err != nil {

0 commit comments

Comments
 (0)