feat: add Runtime interface

Instead of passing around a struct, it is better if we pass around an
interface that describes the behavior we want. The Runtime interface
provides a common place to describe runtime specific parameters. This
initial implementation offers the runtime mode, the platform specifics,
and the config.

Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
This commit is contained in:
Andrew Rynhard
2019-10-11 04:36:00 +00:00
parent e6f980463f
commit 8153c2e2a9
62 changed files with 280 additions and 237 deletions

View File

@@ -17,7 +17,7 @@ import (
"github.com/talos-systems/talos/internal/pkg/installer"
"github.com/talos-systems/talos/internal/pkg/kernel"
"github.com/talos-systems/talos/internal/pkg/platform"
"github.com/talos-systems/talos/internal/pkg/runtime"
"github.com/talos-systems/talos/pkg/blockdevice/probe"
"github.com/talos-systems/talos/pkg/config/machine"
"github.com/talos-systems/talos/pkg/constants"
@@ -28,7 +28,7 @@ import (
type Interactive struct{}
// Initialize implements the Initializer interface.
func (i *Interactive) Initialize(platform platform.Platform, install machine.Install) (err error) {
func (i *Interactive) Initialize(platform runtime.Platform, install machine.Install) (err error) {
var dev *probe.ProbedBlockDevice
dev, err = probe.GetDevWithFileSystemLabel(constants.ISOFilesystemLabel)