Skip to content
This repository was archived by the owner on Sep 24, 2024. It is now read-only.

Commit a2a7888

Browse files
committed
fix: add --cert-dir
1 parent 890ecce commit a2a7888

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

main.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ type Config struct {
6262
EtcdVersion string `env:"ETCD_VERSION, default=3.5.11"`
6363
ApiServerRegistry string `env:"API_SERVER_REGISTRY, default=registry.k8s.io/kube-apiserver"`
6464
EtcdRegistry string `env:"ETCD_REGISTRY, default=quay.io/coreos/etcd"`
65+
CertDir string `env:"CERT_DIR"`
6566
}
6667

6768
var (
@@ -84,6 +85,7 @@ func init() {
8485
flag.StringVarP(&config.ApiServerRegistry, "api-server-registry", "", "", "OCI registry for pulling the kube-apiserver image")
8586
flag.StringVarP(&config.EtcdRegistry, "etcd-registry", "", "", "OCI registry for pulling the etcd image")
8687
flag.StringVarP(&config.EtcdVersion, "etcd-version", "", "", "The version for etcd")
88+
flag.StringVarP(&config.CertDir, "cert-dir", "", "", "Alternative host mount path for the temporary cert directoy. Use only in the case yakmv runs itself within a container and TMPDIR is not the same path as on the docker host.")
8789

8890
tbl = table.NewWriter()
8991
tbl.SetOutputMirror(output)
@@ -500,6 +502,10 @@ func startAPIServer(ctx context.Context, dockerClient *dockerclient.Client, etcd
500502
return types.ContainerJSON{}, err
501503
}
502504

505+
if config.CertDir != "" {
506+
certDir = filepath.Join(config.CertDir, filepath.Base(certDir))
507+
}
508+
503509
tag, _ := strings.CutPrefix(config.KubeVersion, "v")
504510
cont, err := dockerClient.ContainerCreate(
505511
ctx,

0 commit comments

Comments
 (0)