Skip to content

Commit cff5e75

Browse files
authored
Merge pull request #2343 from crosbymichael/platform
Rename Runtime to PlatformRuntime
2 parents 80272bb + ceae112 commit cff5e75

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

linux/runtime.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func init() {
7979
})
8080
}
8181

82-
var _ = (runtime.Runtime)(&Runtime{})
82+
var _ = (runtime.PlatformRuntime)(&Runtime{})
8383

8484
// Config options for the runtime
8585
type Config struct {

runtime/runtime.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ type Exit struct {
5353
Timestamp time.Time
5454
}
5555

56-
// Runtime is responsible for the creation of containers for a certain platform,
57-
// arch, or custom usage.
58-
type Runtime interface {
56+
// PlatformRuntime is responsible for the creation and management of
57+
// tasks and processes for a platform.
58+
type PlatformRuntime interface {
5959
// ID of the runtime
6060
ID() string
6161
// Create creates a task with the provided id and options.

services/tasks/local.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ func initFunc(ic *plugin.InitContext) (interface{}, error) {
7979
return nil, err
8080
}
8181
cs := m.(*metadata.DB).ContentStore()
82-
runtimes := make(map[string]runtime.Runtime)
82+
runtimes := make(map[string]runtime.PlatformRuntime)
8383
for _, rr := range rt {
8484
ri, err := rr.Instance()
8585
if err != nil {
8686
log.G(ic.Context).WithError(err).Warn("could not load runtime instance due to initialization error")
8787
continue
8888
}
89-
r := ri.(runtime.Runtime)
89+
r := ri.(runtime.PlatformRuntime)
9090
runtimes[r.ID()] = r
9191
}
9292

@@ -102,7 +102,7 @@ func initFunc(ic *plugin.InitContext) (interface{}, error) {
102102
}
103103

104104
type local struct {
105-
runtimes map[string]runtime.Runtime
105+
runtimes map[string]runtime.PlatformRuntime
106106
db *metadata.DB
107107
store content.Store
108108
publisher events.Publisher
@@ -625,7 +625,7 @@ func (l *local) getTaskFromContainer(ctx context.Context, container *containers.
625625
return t, nil
626626
}
627627

628-
func (l *local) getRuntime(name string) (runtime.Runtime, error) {
628+
func (l *local) getRuntime(name string) (runtime.PlatformRuntime, error) {
629629
runtime, ok := l.runtimes[name]
630630
if !ok {
631631
return nil, status.Errorf(codes.NotFound, "unknown runtime %q", name)

windows/runtime.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ var (
5353
pluginID = fmt.Sprintf("%s.%s", plugin.RuntimePlugin, runtimeName)
5454
)
5555

56-
var _ = (runtime.Runtime)(&windowsRuntime{})
56+
var _ = (runtime.PlatformRuntime)(&windowsRuntime{})
5757

5858
func init() {
5959
plugin.Register(&plugin.Registration{

0 commit comments

Comments
 (0)