Skip to content

Commit ae221c4

Browse files
author
u220374
committed
Fixed env variable check.
1 parent 3b432e2 commit ae221c4

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

daemon/client/handlers/major.go

+6-5
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@ func HandleMajorChecks(daemonType string, w http.ResponseWriter, r *http.Request
2424
}
2525
}
2626

27-
certPaths := os.Getenv("CHECK_CERTIFICATE_PATHS")
28-
if len(certPaths) == 0 {
29-
log.Fatal("env variables 'CHECK_CERTIFICATE_PATHS' must be specified")
30-
}
31-
3227
if daemonType == "MASTER" || daemonType == "NODE" {
28+
certPaths := os.Getenv("CHECK_CERTIFICATE_PATHS")
29+
30+
if len(certPaths) == 0 {
31+
log.Fatal("env variables 'CHECK_CERTIFICATE_PATHS' must be specified")
32+
}
33+
3334
if err := checks.CheckFileSslCertificates(strings.Split(certPaths, ","), 30); err != nil {
3435
errors = append(errors, err.Error())
3536
}

daemon/client/handlers/minor.go

+6-5
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ func HandleMinorChecks(daemonType string, w http.ResponseWriter, r *http.Request
2121
}
2222
}
2323

24-
certPaths := os.Getenv("CHECK_CERTIFICATE_PATHS")
25-
if len(certPaths) == 0 {
26-
log.Fatal("env variables 'CHECK_CERTIFICATE_PATHS' must be specified")
27-
}
28-
2924
if daemonType == "MASTER" || daemonType == "NODE" {
25+
certPaths := os.Getenv("CHECK_CERTIFICATE_PATHS")
26+
27+
if len(certPaths) == 0 {
28+
log.Fatal("env variables 'CHECK_CERTIFICATE_PATHS' must be specified")
29+
}
30+
3031
if err := checks.CheckFileSslCertificates(strings.Split(certPaths, ","), 80); err != nil {
3132
errors = append(errors, err.Error())
3233
}

0 commit comments

Comments
 (0)