Skip to content

Commit

Permalink
PMM-5086-12634 Fix for TextFiles and templateParams.
Browse files Browse the repository at this point in the history
  • Loading branch information
JiriCtvrtka committed Dec 3, 2024
1 parent d7c6980 commit d3ca4e3
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions managed/models/agent_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,10 @@ func (s Agent) Files() map[string]string {
if s.MySQLOptions.TLSKey != "" {
files["tlsKey"] = s.MySQLOptions.TLSKey
}
return files

if len(files) != 0 {
return files
}
}
return nil
case ProxySQLExporterType:
Expand All @@ -687,7 +690,10 @@ func (s Agent) Files() map[string]string {
if s.MongoDBOptions.TLSCertificateKey != "" {
files[certificateKeyFilePlaceholder] = s.MongoDBOptions.TLSCertificateKey
}
return files

if len(files) != 0 {
return files
}
}
return nil
case PostgresExporterType, QANPostgreSQLPgStatementsAgentType, QANPostgreSQLPgStatMonitorAgentType:
Expand All @@ -703,7 +709,10 @@ func (s Agent) Files() map[string]string {
if s.PostgreSQLOptions.SSLKey != "" {
files[certificateKeyFilePlaceholder] = s.PostgreSQLOptions.SSLKey
}
return files

if len(files) != 0 {
return files
}
}
return nil
default:
Expand All @@ -726,15 +735,15 @@ func (s Agent) TemplateDelimiters(svc *Service) *DelimiterPair {

switch svc.ServiceType {
case MySQLServiceType:
if s.MySQLOptions != nil {
if s.MySQLOptions != nil && s.MySQLOptions.TLSKey != "" {
templateParams = append(templateParams, s.MySQLOptions.TLSKey)
}
case MongoDBServiceType:
if s.MongoDBOptions != nil {
if s.MongoDBOptions != nil && s.MongoDBOptions.TLSCertificateKeyFilePassword != "" {
templateParams = append(templateParams, s.MongoDBOptions.TLSCertificateKeyFilePassword)
}
case PostgreSQLServiceType:
if s.PostgreSQLOptions != nil {
if s.PostgreSQLOptions != nil && s.PostgreSQLOptions.SSLKey != "" {
templateParams = append(templateParams, s.PostgreSQLOptions.SSLKey)
}
case ProxySQLServiceType:
Expand Down

0 comments on commit d3ca4e3

Please sign in to comment.