Skip to content

Commit

Permalink
fix(platform): persistent envent flaw (tkestack#960)
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo Ryu committed Dec 1, 2020
1 parent 10e2ac1 commit 7588fb4
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,15 @@ func (c *Controller) makeConfigMap(ctx context.Context, backend *v1.PersistentBa
backend.ES.Password = string(password)
}

if backend.ES != nil {
backend.ES.IndexName = template.JSEscapeString(backend.ES.IndexName)
backend.ES.Scheme = template.JSEscapeString(backend.ES.Scheme)
backend.ES.IP = template.JSEscapeString(backend.ES.IP)
} else if backend.CLS != nil {
backend.CLS.LogSetID = template.JSEscapeString(backend.CLS.LogSetID)
backend.CLS.TopicID = template.JSEscapeString(backend.CLS.TopicID)
}

var b bytes.Buffer
if err = configTmpl.Execute(&b, backend); err != nil {
return nil, err
Expand Down

0 comments on commit 7588fb4

Please sign in to comment.