Skip to content

Commit

Permalink
move regerating certs message outside of isValid func
Browse files Browse the repository at this point in the history
  • Loading branch information
spowelljr committed Apr 10, 2023
1 parent fb37175 commit 98a41fa
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/minikube/bootstrapper/certs.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ func generateKubeadmCerts(cmd command.Runner, cc config.ClusterConfig) error {
if !needsRefresh {
return nil
}
out.WarningT("kubeadm certificates have expired. Generating new ones...")
kubeadmPath := path.Join(vmpath.GuestPersistentDir, "binaries", cc.KubernetesConfig.KubernetesVersion)
bashCmd := fmt.Sprintf("sudo env PATH=\"%s:$PATH\" kubeadm certs renew all --config %s", kubeadmPath, constants.KubeadmYamlPath)
if _, err := cmd.RunCmd(exec.Command("/bin/bash", "-c", bashCmd)); err != nil {
Expand Down Expand Up @@ -597,7 +598,6 @@ func isKubeadmCertValid(cmd command.Runner, certPath string) bool {
}

if cert.NotAfter.Before(time.Now()) {
out.WarningT("Certificate {{.certPath}} has expired. Generating a new one...", out.V{"certPath": filepath.Base(certPath)})
klog.Infof("cert expired %s: expiration: %s, now: %s", certPath, cert.NotAfter, time.Now())
return false
}
Expand Down
1 change: 1 addition & 0 deletions translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,7 @@
"invalid kubernetes version": "Invalide Kubernetes Version",
"json encoding failure": "",
"keep the kube-context active after cluster is stopped. Defaults to false.": "Halte den kube-context aktiv, wenn der Cluster gestoppt ist. Default: false",
"kubeadm certificates have expired. Generating new ones...": "",
"kubeadm detected a TCP port conflict with another process: probably another local Kubernetes installation. Run lsof -p\u003cport\u003e to find the process and kill it": "kubeadm erkannte einen TCP Port Konflikt mit anderen Prozessen: wahrscheinlich eine andere lokale Kubernetes Installation. Führe lsof -p\u003cport\u003e aus um den Prozess zu finden und zu töten",
"kubectl and minikube configuration will be stored in {{.home_folder}}": "Konfiguration von Kubectl und minikube wird in {{.home_folder}} gespeichert",
"kubectl not found. If you need it, try: 'minikube kubectl -- get pods -A'": "kubectl nicht gefunden. Falls Sie es benötigen, versuchen Sie 'minikube kubectl -- get pods -A' aufzurufen",
Expand Down
1 change: 1 addition & 0 deletions translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,7 @@
"invalid kubernetes version": "",
"json encoding failure": "",
"keep the kube-context active after cluster is stopped. Defaults to false.": "",
"kubeadm certificates have expired. Generating new ones...": "",
"kubeadm detected a TCP port conflict with another process: probably another local Kubernetes installation. Run lsof -p\u003cport\u003e to find the process and kill it": "",
"kubectl and minikube configuration will be stored in {{.home_folder}}": "La configuración de kubectl y de minikube se almacenará en {{.home_folder}}",
"kubectl not found. If you need it, try: 'minikube kubectl -- get pods -A'": "",
Expand Down
1 change: 1 addition & 0 deletions translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,7 @@
"invalid kubernetes version": "version kubernetes invalide",
"json encoding failure": "échec de l'encodage json",
"keep the kube-context active after cluster is stopped. Defaults to false.": "garder le kube-context actif après l'arrêt du cluster. La valeur par défaut est false.",
"kubeadm certificates have expired. Generating new ones...": "",
"kubeadm detected a TCP port conflict with another process: probably another local Kubernetes installation. Run lsof -p\u003cport\u003e to find the process and kill it": "kubeadm a détecté un conflit de port TCP avec un autre processus : probablement une autre installation locale de Kubernetes. Exécutez lsof -p\u003cport\u003e pour trouver le processus et le tuer",
"kubectl and minikube configuration will be stored in {{.home_folder}}": "Les configurations kubectl et minikube seront stockées dans le dossier {{.home_folder}}.",
"kubectl not found. If you need it, try: 'minikube kubectl -- get pods -A'": "kubectl introuvable. Si vous en avez besoin, essayez : 'minikube kubectl -- get pods -A'",
Expand Down
1 change: 1 addition & 0 deletions translations/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,7 @@
"invalid kubernetes version": "無効な Kubernetes バージョン",
"json encoding failure": "json エンコード失敗",
"keep the kube-context active after cluster is stopped. Defaults to false.": "クラスター停止後に kube-context をアクティブのままにします。デフォルトは false です。",
"kubeadm certificates have expired. Generating new ones...": "",
"kubeadm detected a TCP port conflict with another process: probably another local Kubernetes installation. Run lsof -p\u003cport\u003e to find the process and kill it": "kubeadm が他のプロセス (おそらくローカルにインストールされた他の Kubernetes) との TCP ポート衝突を検出しました。 lsof -p\u003cport\u003e を実行してそのプロセスを特定し、停止してください",
"kubectl and minikube configuration will be stored in {{.home_folder}}": "kubectl と minikube の構成は {{.home_folder}} に保存されます",
"kubectl not found. If you need it, try: 'minikube kubectl -- get pods -A'": "kubectl が見つかりません。kubectl が必要な場合、'minikube kubectl -- get pods -A' を試してください",
Expand Down
1 change: 1 addition & 0 deletions translations/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,7 @@
"invalid kubernetes version": "",
"json encoding failure": "",
"keep the kube-context active after cluster is stopped. Defaults to false.": "",
"kubeadm certificates have expired. Generating new ones...": "",
"kubeadm detected a TCP port conflict with another process: probably another local Kubernetes installation. Run lsof -p\u003cport\u003e to find the process and kill it": "",
"kubectl and minikube configuration will be stored in {{.home_folder}}": "kubectl 과 minikube 환경 정보는 {{.home_folder}} 에 저장될 것입니다",
"kubectl not found in PATH, but is required for the dashboard. Installation guide: https://kubernetes.io/docs/tasks/tools/install-kubectl/": "kubectl 이 PATH 에 없습니다, 하지만 이는 대시보드에서 필요로 합니다. 설치 가이드:https://kubernetes.io/docs/tasks/tools/install-kubectl/",
Expand Down
1 change: 1 addition & 0 deletions translations/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,7 @@
"invalid kubernetes version": "Nieprawidłowa wersja Kubernetesa",
"json encoding failure": "",
"keep the kube-context active after cluster is stopped. Defaults to false.": "",
"kubeadm certificates have expired. Generating new ones...": "",
"kubeadm detected a TCP port conflict with another process: probably another local Kubernetes installation. Run lsof -p\u003cport\u003e to find the process and kill it": "",
"kubectl and minikube configuration will be stored in {{.home_folder}}": "konfiguracja minikube i kubectl będzie przechowywana w katalogu {{.home_folder}}",
"kubectl not found in PATH, but is required for the dashboard. Installation guide: https://kubernetes.io/docs/tasks/tools/install-kubectl/": "kubectl nie zostało odnalezione w zmiennej środowiskowej ${PATH}. Instrukcja instalacji: https://kubernetes.io/docs/tasks/tools/install-kubectl/",
Expand Down
1 change: 1 addition & 0 deletions translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,7 @@
"invalid kubernetes version": "",
"json encoding failure": "",
"keep the kube-context active after cluster is stopped. Defaults to false.": "",
"kubeadm certificates have expired. Generating new ones...": "",
"kubeadm detected a TCP port conflict with another process: probably another local Kubernetes installation. Run lsof -p\u003cport\u003e to find the process and kill it": "",
"kubectl and minikube configuration will be stored in {{.home_folder}}": "",
"kubectl not found. If you need it, try: 'minikube kubectl -- get pods -A'": "",
Expand Down
1 change: 1 addition & 0 deletions translations/strings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,7 @@
"invalid kubernetes version": "",
"json encoding failure": "",
"keep the kube-context active after cluster is stopped. Defaults to false.": "",
"kubeadm certificates have expired. Generating new ones...": "",
"kubeadm detected a TCP port conflict with another process: probably another local Kubernetes installation. Run lsof -p\u003cport\u003e to find the process and kill it": "",
"kubectl and minikube configuration will be stored in {{.home_folder}}": "",
"kubectl not found. If you need it, try: 'minikube kubectl -- get pods -A'": "",
Expand Down
1 change: 1 addition & 0 deletions translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -1093,6 +1093,7 @@
"invalid kubernetes version": "",
"json encoding failure": "",
"keep the kube-context active after cluster is stopped. Defaults to false.": "",
"kubeadm certificates have expired. Generating new ones...": "",
"kubeadm detected a TCP port conflict with another process: probably another local Kubernetes installation. Run lsof -p\u003cport\u003e to find the process and kill it": "kubeadm 检测一个到与其他进程的 TCP 端口冲突:或许是另外的本地安装的 Kubernetes 导致。执行 lsof -p\u003cport\u003e 查找并杀死这些进程",
"kubectl and minikube configuration will be stored in {{.home_folder}}": "kubectl 和 minikube 配置将存储在 {{.home_folder}} 中",
"kubectl not found. If you need it, try: 'minikube kubectl -- get pods -A'": "",
Expand Down

0 comments on commit 98a41fa

Please sign in to comment.