This repository has been archived by the owner on May 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #194 from devimc/cli/fixPs
grpc: implement ListProcesses
- Loading branch information
Showing
10 changed files
with
1,022 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
// | ||
// Copyright (c) 2018 Intel Corporation | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
package main | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/opencontainers/runc/libcontainer" | ||
"github.com/opencontainers/runc/libcontainer/configs" | ||
) | ||
|
||
type mockContainer struct { | ||
id string | ||
status libcontainer.Status | ||
processes []int | ||
} | ||
|
||
func (m *mockContainer) ID() string { | ||
return m.id | ||
} | ||
|
||
func (m *mockContainer) Status() (libcontainer.Status, error) { | ||
return m.status, nil | ||
} | ||
|
||
func (m *mockContainer) State() (*libcontainer.State, error) { | ||
return nil, nil | ||
} | ||
|
||
func (m *mockContainer) Config() configs.Config { | ||
return configs.Config{} | ||
} | ||
|
||
func (m *mockContainer) Processes() ([]int, error) { | ||
return m.processes, nil | ||
} | ||
|
||
func (m *mockContainer) Stats() (*libcontainer.Stats, error) { | ||
return nil, nil | ||
} | ||
|
||
func (m *mockContainer) Set(config configs.Config) error { | ||
return nil | ||
} | ||
|
||
func (m *mockContainer) Start(process *libcontainer.Process) (err error) { | ||
return nil | ||
} | ||
|
||
func (m *mockContainer) Run(process *libcontainer.Process) (err error) { | ||
return nil | ||
} | ||
|
||
func (m *mockContainer) Destroy() error { | ||
return nil | ||
} | ||
|
||
func (m *mockContainer) Signal(s os.Signal, all bool) error { | ||
return nil | ||
} | ||
|
||
func (m *mockContainer) Exec() error { | ||
return nil | ||
} | ||
|
||
func (m *mockContainer) Checkpoint(criuOpts *libcontainer.CriuOpts) error { | ||
return nil | ||
} | ||
|
||
func (m *mockContainer) Restore(process *libcontainer.Process, criuOpts *libcontainer.CriuOpts) error { | ||
return nil | ||
} | ||
|
||
func (m *mockContainer) Pause() error { | ||
return nil | ||
} | ||
|
||
func (m *mockContainer) Resume() error { | ||
return nil | ||
} | ||
|
||
func (m *mockContainer) NotifyOOM() (<-chan struct{}, error) { | ||
return nil, nil | ||
} | ||
|
||
func (m *mockContainer) NotifyMemoryPressure(level libcontainer.PressureLevel) (<-chan struct{}, error) { | ||
return nil, nil | ||
} |
Oops, something went wrong.