Skip to content

Commit

Permalink
removed InspectContainer(...) from runtime interface since it is not …
Browse files Browse the repository at this point in the history
…used
  • Loading branch information
steiler committed Jun 17, 2021
1 parent 417a7b9 commit e38757a
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 15 deletions.
3 changes: 0 additions & 3 deletions runtime/containerd/containerd.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,6 @@ func (c *ContainerdRuntime) DeleteNet(context.Context) error {
log.Debug("DeleteNet() - Not yet required with containerd")
return nil
}
func (c *ContainerdRuntime) ContainerInspect(context.Context, string) (*types.GenericContainer, error) {
return nil, errors.New("not implemented")
}

func (c *ContainerdRuntime) PullImageIfRequired(ctx context.Context, imagename string) error {

Expand Down
10 changes: 0 additions & 10 deletions runtime/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -515,16 +515,6 @@ func setSysctl(sysctl string, newVal int) error {
return ioutil.WriteFile(path.Join(sysctlBase, sysctl), []byte(strconv.Itoa(newVal)), 0640)
}

func (c *DockerRuntime) ContainerInspect(ctx context.Context, id string) (*types.GenericContainer, error) {
ctr, err := c.Client.ContainerInspect(ctx, id)
if err != nil {
return nil, err
}
return &types.GenericContainer{
Pid: ctr.State.Pid,
}, nil
}

func (c *DockerRuntime) StopContainer(ctx context.Context, name string, dur *time.Duration) error {
c.Client.ContainerKill(ctx, name, "kill")
return nil
Expand Down
2 changes: 0 additions & 2 deletions runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ type ContainerRuntime interface {
StopContainer(context.Context, string, *time.Duration) error
// List all containers matching labels
ListContainers(context.Context, []*types.GenericFilter) ([]types.GenericContainer, error)
// Inspect container (extract its PID)
ContainerInspect(context.Context, string) (*types.GenericContainer, error)
// Get a netns path using the pid of a container
GetNSPath(context.Context, string) (string, error)
// Executes cmd on container identified with id and returns stdout, stderr bytes and an error
Expand Down

0 comments on commit e38757a

Please sign in to comment.