Allow specifying image names on 'kind build'

This commit is contained in:
James Munnelly
2018-09-07 17:13:23 +01:00
committed by Benjamin Elder
parent b7f0de049a
commit d1c013ba27
4 changed files with 16 additions and 10 deletions

View File

@@ -40,9 +40,9 @@ type BaseImageBuildContext struct {
// NewBaseImageBuildContext creates a new BaseImageBuildContext with
// default configuration
func NewBaseImageBuildContext() *BaseImageBuildContext {
func NewBaseImageBuildContext(imageName string) *BaseImageBuildContext {
return &BaseImageBuildContext{
ImageTag: "kind-base",
ImageTag: imageName,
GoCmd: "go",
Arch: "amd64",
}

View File

@@ -41,7 +41,7 @@ type NodeImageBuildContext struct {
// NewNodeImageBuildContext creates a new NodeImageBuildContext with
// default configuration
func NewNodeImageBuildContext(mode string) (ctx *NodeImageBuildContext, err error) {
func NewNodeImageBuildContext(mode, imageName, baseImageName string) (ctx *NodeImageBuildContext, err error) {
kubeRoot := ""
// apt should not fail on finding kube root as it does not use it
if mode != "apt" {
@@ -55,9 +55,9 @@ func NewNodeImageBuildContext(mode string) (ctx *NodeImageBuildContext, err erro
return nil, err
}
return &NodeImageBuildContext{
ImageTag: "kind-node",
ImageTag: imageName,
Arch: "amd64",
BaseImage: "kind-base",
BaseImage: baseImageName,
KubeRoot: kubeRoot,
Bits: bits,
}, nil