From cce503033d50d7b11d9428e8d031e3fd5c6c483b Mon Sep 17 00:00:00 2001 From: Medya Gh Date: Thu, 19 Dec 2019 11:12:49 -0800 Subject: [PATCH] rename CreateParam to CreateConfig --- pkg/drivers/kic/kic.go | 2 +- pkg/drivers/kic/node/node.go | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pkg/drivers/kic/kic.go b/pkg/drivers/kic/kic.go index 955de2be8d..8dfaabd992 100644 --- a/pkg/drivers/kic/kic.go +++ b/pkg/drivers/kic/kic.go @@ -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, diff --git a/pkg/drivers/kic/node/node.go b/pkg/drivers/kic/node/node.go index 59253ede94..acb8005a6e 100644 --- a/pkg/drivers/kic/node/node.go +++ b/pkg/drivers/kic/node/node.go @@ -45,22 +45,22 @@ type Node struct { ociBinary string } -type CreateParams struct { - Name string // used for container name and hostname - Image string // container image to use to create the node. - ClusterLabel string - 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 +type CreateConfig struct { + Name string // used for container name and hostname + Image string // container image to use to create the node. + 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 // 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),