rename CreateParam to CreateConfig
parent
e1d5704170
commit
cce503033d
|
@ -70,7 +70,7 @@ func NewDriver(c Config) *Driver {
|
||||||
|
|
||||||
// Create a host using the driver's config
|
// Create a host using the driver's config
|
||||||
func (d *Driver) Create() error {
|
func (d *Driver) Create() error {
|
||||||
params := node.CreateParams{ // TODO:medyagh simplify this to have less overla
|
params := node.CreateConfig{
|
||||||
Name: d.NodeConfig.MachineName,
|
Name: d.NodeConfig.MachineName,
|
||||||
Image: d.NodeConfig.ImageDigest,
|
Image: d.NodeConfig.ImageDigest,
|
||||||
ClusterLabel: node.ClusterLabelKey + "=" + d.MachineName,
|
ClusterLabel: node.ClusterLabelKey + "=" + d.MachineName,
|
||||||
|
|
|
@ -45,22 +45,22 @@ type Node struct {
|
||||||
ociBinary string
|
ociBinary string
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreateParams struct {
|
type CreateConfig struct {
|
||||||
Name string // used for container name and hostname
|
Name string // used for container name and hostname
|
||||||
Image string // container image to use to create the node.
|
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
|
Role string // currently only role supported is control-plane
|
||||||
Mounts []oci.Mount
|
Mounts []oci.Mount // volume mounts
|
||||||
PortMappings []oci.PortMapping
|
PortMappings []oci.PortMapping // ports to map to container from host
|
||||||
CPUs string
|
CPUs string // number of cpu cores assign to container
|
||||||
Memory string
|
Memory string // memory (mbs) to assign to the container
|
||||||
Envs map[string]string
|
Envs map[string]string // environment variables to pass to the container
|
||||||
ExtraArgs []string
|
ExtraArgs []string // a list of any extra option to pass to oci binary during creation time, for example --expose 8080...
|
||||||
OCIBinary string
|
OCIBinary string // docker or podman
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateNode creates a new container node
|
// 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)
|
cmder := command.NewKICRunner(p.Name, p.OCIBinary)
|
||||||
runArgs := []string{
|
runArgs := []string{
|
||||||
fmt.Sprintf("--cpus=%s", p.CPUs),
|
fmt.Sprintf("--cpus=%s", p.CPUs),
|
||||||
|
|
Loading…
Reference in New Issue