Skip to content

Commit

Permalink
skip empty cert paths
Browse files Browse the repository at this point in the history
  • Loading branch information
jpinsonneau committed Apr 4, 2023
1 parent bb80b4f commit 3d54fce
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions controllers/consoleplugin/consoleplugin_objects.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,10 @@ func buildArgs(desired *flowslatest.FlowCollectorSpec) []string {
if desired.Loki.TLS.InsecureSkipVerify {
args = append(args, "-loki-skip-tls")
} else {
args = append(args, "-loki-ca-path", helper.GetCACertPath(&desired.Loki.TLS, lokiCerts))
caPath := helper.GetCACertPath(&desired.Loki.TLS, lokiCerts)
if caPath != "" {
args = append(args, "--loki-ca-path", caPath)
}
}
}

Expand All @@ -188,9 +191,16 @@ func buildArgs(desired *flowslatest.FlowCollectorSpec) []string {
if statusTLS.InsecureSkipVerify {
args = append(args, "-loki-status-skip-tls")
} else {
args = append(args, "-loki-status-ca-path", helper.GetCACertPath(&statusTLS, lokiStatusCerts))
args = append(args, "-loki-status-user-cert-path", helper.GetUserCertPath(&statusTLS, lokiStatusCerts))
args = append(args, "-loki-status-user-key-path", helper.GetUserKeyPath(&statusTLS, lokiStatusCerts))
statusCaPath := helper.GetCACertPath(&statusTLS, lokiStatusCerts)
if statusCaPath != "" {
args = append(args, "--loki-status-ca-path", statusCaPath)
}
userCertPath := helper.GetUserCertPath(&statusTLS, lokiStatusCerts)
userKeyPath := helper.GetUserKeyPath(&statusTLS, lokiStatusCerts)
if userCertPath != "" && userKeyPath != "" {
args = append(args, "--loki-status-user-cert-path", userCertPath)
args = append(args, "--loki-status-user-key-path", userKeyPath)
}
}
}

Expand Down

0 comments on commit 3d54fce

Please sign in to comment.