Merge branch 'main' of https://github.com/kubesphere/kubeye into main

This commit is contained in:
shaowenchen 2021-01-07 15:43:21 +08:00
commit 1a670316ae
1 changed files with 12 additions and 10 deletions

View File

@ -58,6 +58,7 @@ func Cluster(configuration string, ctx context.Context, allInformation bool) err
output, _ := exec.Command("/bin/sh", "-c", cmd).CombinedOutput()
if output != nil {
certs, _ := certutil.ParseCertsPEM([]byte(output))
if len(certs) != 0 {
certExpire := Certificate{
Name: "kube-apiserver",
Expires: certs[0].NotAfter.Format("Jan 02, 2006 15:04 MST"),
@ -72,6 +73,7 @@ func Cluster(configuration string, ctx context.Context, allInformation bool) err
certExpires = append(certExpires, certExpire)
}
}
}
var config conf.Configuration
var goodPractice []PodResult