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

[Bug] Syncfile can not Filter configuration item that contain middle space #345

Open
caoxianfei1 opened this issue Nov 17, 2023 · 0 comments
Assignees
Labels
bug Something isn't working priority/important-soon

Comments

@caoxianfei1
Copy link
Contributor

Report a bug.

SyncFile step contains three steps:

  1. Read primary config file to a temporary file.
  2. Filter key and value according to delimtier(such as '=' or ':') and mutate item according vaiable that user configure.
  3. Write modified content back to file.
    you can see at
    func (s *SyncFile) Execute(ctx *context.Context) error {

However, configuration items containing middle spaces cannot be filtered. If one or more spaces, they will be truncated.

for example:

s3.user_agent=S3 Browser

will be filter as follow:

s3.user_agent=S3

The reason may be REGEX_KV_SPLIT

REGEX_KV_SPLIT = "^(([^%s]+)%s\\s*)([^\\s#]*)" // key: mu[2] value: mu[3]

@caoxianfei1 caoxianfei1 self-assigned this Nov 17, 2023
@caoxianfei1 caoxianfei1 added bug Something isn't working priority/important-soon labels Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority/important-soon
Projects
None yet
Development

No branches or pull requests

1 participant