Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reformat add_lua_script.go #427

Merged
merged 2 commits into from
Feb 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions confgenerator/add_lua_script.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
package confgenerator

import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"fmt"
"io/ioutil"
"os"
"path/filepath"
)

const addLogNameLuaScriptContents string = `
Expand Down Expand Up @@ -62,12 +62,12 @@ end
// TODO(ridwanmsharif): Replace this with in-config script when
// fluent/fluent-bit#4634 is supported.
func writeForwardScript(path string) error {
// Make sure the directory exists before writing the file.
if err := os.MkdirAll(filepath.Dir(path), 0755); err != nil {
return fmt.Errorf("failed to create directory for %q: %w", path, err)
}
if err := ioutil.WriteFile(path, []byte(addLogNameLuaScriptContents), 0644); err != nil {
return fmt.Errorf("failed to write file to %q: %w", path, err)
}
return nil
// Make sure the directory exists before writing the file.
if err := os.MkdirAll(filepath.Dir(path), 0755); err != nil {
return fmt.Errorf("failed to create directory for %q: %w", path, err)
}
if err := ioutil.WriteFile(path, []byte(addLogNameLuaScriptContents), 0644); err != nil {
return fmt.Errorf("failed to write file to %q: %w", path, err)
}
return nil
}
4 changes: 2 additions & 2 deletions confgenerator/confgenerator.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func (l *Logging) generateFluentbitComponents(userAgent string, hostInfo *host.I
regexSuffix = `\..*`
globSuffix = `.*`
}
tags = append(tags, regexp.QuoteMeta(tag) + regexSuffix)
tags = append(tags, regexp.QuoteMeta(tag)+regexSuffix)
tag = tag + globSuffix

for i, pID := range p.ProcessorIDs {
Expand Down Expand Up @@ -273,4 +273,4 @@ func getMD5Hash(text string) string {
hasher := md5.New()
hasher.Write([]byte(text))
return hex.EncodeToString(hasher.Sum(nil))
}
}