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

Commit

Permalink
fix: remove --cert-dir flag, do not panic if err > 0
Browse files Browse the repository at this point in the history
  • Loading branch information
raffis committed Feb 8, 2024
1 parent fec2a13 commit 01df9b3
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ type Config struct {
EtcdVersion string `env:"ETCD_VERSION, default=3.5.11"`
ApiServerRegistry string `env:"API_SERVER_REGISTRY, default=registry.k8s.io/kube-apiserver"`
EtcdRegistry string `env:"ETCD_REGISTRY, default=quay.io/coreos/etcd"`
CertDir string `env:"CERT_DIR"`
}

var (
Expand All @@ -85,7 +84,6 @@ func init() {
flag.StringVarP(&config.ApiServerRegistry, "api-server-registry", "", "", "OCI registry for pulling the kube-apiserver image")
flag.StringVarP(&config.EtcdRegistry, "etcd-registry", "", "", "OCI registry for pulling the etcd image")
flag.StringVarP(&config.EtcdVersion, "etcd-version", "", "", "The version for etcd")
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.")

tbl = table.NewWriter()
tbl.SetOutputMirror(output)
Expand Down Expand Up @@ -238,7 +236,7 @@ func main() {
}

if !config.AllowFailure && sum.errors > 0 {
panic("at least one resource is invalid")
os.Exit(1)
}
}

Expand Down Expand Up @@ -502,10 +500,6 @@ func startAPIServer(ctx context.Context, dockerClient *dockerclient.Client, etcd
return types.ContainerJSON{}, err
}

if config.CertDir != "" {
certDir = filepath.Join(config.CertDir, filepath.Base(certDir))
}

tag, _ := strings.CutPrefix(config.KubeVersion, "v")
cont, err := dockerClient.ContainerCreate(
ctx,
Expand Down

0 comments on commit 01df9b3

Please sign in to comment.