rename CreateParam to CreateConfig

pull/6112/head
Medya Gh 2019-12-19 11:12:49 -08:00
parent e1d5704170
commit cce503033d
2 changed files with 14 additions and 14 deletions

View File

@ -70,7 +70,7 @@ func NewDriver(c Config) *Driver {
// Create a host using the driver's config
func (d *Driver) Create() error {
params := node.CreateParams{ // TODO:medyagh simplify this to have less overla
params := node.CreateConfig{
Name: d.NodeConfig.MachineName,
Image: d.NodeConfig.ImageDigest,
ClusterLabel: node.ClusterLabelKey + "=" + d.MachineName,

View File

@ -45,22 +45,22 @@ type Node struct {
ociBinary string
}
type CreateParams struct {
type CreateConfig struct {
Name string // used for container name and hostname
Image string // container image to use to create the node.
ClusterLabel string
ClusterLabel string // label the containers we create using minikube so we can clean up
Role string // currently only role supported is control-plane
Mounts []oci.Mount
PortMappings []oci.PortMapping
CPUs string
Memory string
Envs map[string]string
ExtraArgs []string
OCIBinary string
Mounts []oci.Mount // volume mounts
PortMappings []oci.PortMapping // ports to map to container from host
CPUs string // number of cpu cores assign to container
Memory string // memory (mbs) to assign to the container
Envs map[string]string // environment variables to pass to the container
ExtraArgs []string // a list of any extra option to pass to oci binary during creation time, for example --expose 8080...
OCIBinary string // docker or podman
}
// CreateNode creates a new container node
func CreateNode(p CreateParams) (*Node, error) {
func CreateNode(p CreateConfig) (*Node, error) {
cmder := command.NewKICRunner(p.Name, p.OCIBinary)
runArgs := []string{
fmt.Sprintf("--cpus=%s", p.CPUs),