Skip to content

Commit

Permalink
PMM-12153 rename tls params
Browse files Browse the repository at this point in the history
  • Loading branch information
ademidoff committed Mar 7, 2025
1 parent 10794b2 commit 59fe7a1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 13 deletions.
1 change: 1 addition & 0 deletions managed/models/agent_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,7 @@ const webConfigTemplate = `basic_auth_users:

// BuildWebConfigFile builds prometheus-compatible basic auth configuration.
func (s *Agent) BuildWebConfigFile() (string, error) {
// If not provided by the user, it is the `agent_id`.
password := s.GetAgentPassword()
salt := getPasswordSalt(s)

Expand Down
38 changes: 25 additions & 13 deletions managed/services/agents/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,21 +117,33 @@ func mysqldExporterConfig(

files := exporter.Files()
if files != nil {
// // Newer versions of exporter expect these to be provided in `my.cnf` file
// if pmmAgentVersion.Less(v3_2_0) {
for k := range files {
switch k {
case "tlsCa":
args = append(args, "--mysql.ssl-ca-file="+tdp.Left+" .TextFiles.tlsCa "+tdp.Right)
case "tlsCert":
args = append(args, "--mysql.ssl-cert-file="+tdp.Left+" .TextFiles.tlsCert "+tdp.Right)
case "tlsKey":
args = append(args, "--mysql.ssl-key-file="+tdp.Left+" .TextFiles.tlsKey "+tdp.Right)
default:
continue
if pmmAgentVersion.Less(v3_2_0) {
for k := range files {
switch k {
case "tlsCa":
args = append(args, "--mysql.ssl-ca-file="+tdp.Left+" .TextFiles.tlsCa "+tdp.Right)
case "tlsCert":
args = append(args, "--mysql.ssl-cert-file="+tdp.Left+" .TextFiles.tlsCert "+tdp.Right)
case "tlsKey":
args = append(args, "--mysql.ssl-key-file="+tdp.Left+" .TextFiles.tlsKey "+tdp.Right)
default:
continue
}
}
} else {
for k := range files {
switch k {
case "tlsCa":
args = append(args, "--tls.ssl-ca="+tdp.Left+" .TextFiles.tlsCa "+tdp.Right)
case "tlsCert":
args = append(args, "--tls.ssl-cert="+tdp.Left+" .TextFiles.tlsCert "+tdp.Right)
case "tlsKey":
args = append(args, "--tls.ssl-key="+tdp.Left+" .TextFiles.tlsKey "+tdp.Right)
default:
continue
}
}
}
// }

if exporter.TLSSkipVerify {
if pmmAgentVersion.Less(v3_2_0) {
Expand Down

0 comments on commit 59fe7a1

Please sign in to comment.