diff --git a/pkg/config/transform.go b/pkg/config/transform.go index 994d47570c..1107ba441d 100644 --- a/pkg/config/transform.go +++ b/pkg/config/transform.go @@ -314,10 +314,15 @@ func TransformSimpleToClusterConfig(ctx context.Context, runtime runtimes.Runtim regName = simpleConfig.Registries.Create.Name } + image := fmt.Sprintf("%s:%s", k3d.DefaultRegistryImageRepo, k3d.DefaultRegistryImageTag) + if simpleConfig.Registries.Create.Image != "" { + image = simpleConfig.Registries.Create.Image + } + clusterCreateOpts.Registries.Create = &k3d.Registry{ ClusterRef: newCluster.Name, Host: regName, - Image: fmt.Sprintf("%s:%s", k3d.DefaultRegistryImageRepo, k3d.DefaultRegistryImageTag), + Image: image, ExposureOpts: *regPort, } } diff --git a/pkg/config/v1alpha4/schema.json b/pkg/config/v1alpha4/schema.json index 37c99eaf42..c9299806c5 100644 --- a/pkg/config/v1alpha4/schema.json +++ b/pkg/config/v1alpha4/schema.json @@ -294,7 +294,13 @@ "2345" ], "default": "random" - } + }, + "image": { + "type": "string", + "examples": [ + "myregistry/registry:2" + ], + "default": "docker.io/library/registry:2" }, "additionalProperties": false }, diff --git a/pkg/config/v1alpha4/types.go b/pkg/config/v1alpha4/types.go index 378275a77c..9fdfdb127b 100644 --- a/pkg/config/v1alpha4/types.go +++ b/pkg/config/v1alpha4/types.go @@ -85,6 +85,7 @@ type SimpleConfigRegistryCreateConfig struct { Name string `mapstructure:"name" yaml:"name,omitempty" json:"name,omitempty"` Host string `mapstructure:"host" yaml:"host,omitempty" json:"host,omitempty"` HostPort string `mapstructure:"hostPort" yaml:"hostPort,omitempty" json:"hostPort,omitempty"` + Image string `mapstructure:"image" yaml:"image,omitempty" json:"image,omitempty"` } // SimpleConfigOptionsKubeconfig describes the set of options referring to the kubeconfig during cluster creation.