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

The "includes" section in the YAML config does not treat fully qualified paths as fully qualified paths on Windows #9825

Open
williamb1024 opened this issue Jan 12, 2025 · 0 comments

Comments

@williamb1024
Copy link

Bug Report

Describe the bug
When using a fully qualified path within the includes section of the YAML configuration, the provided value is prepended with the directory of the containing configuration file. This occurs even when the provided value is a valid fully qualified path according to Windows standards.

To Reproduce

  • Create a configuration that has an includes section and attempts to include a fully qualified file name, ie: C:\test\fluent-bit.yaml

Expected behavior
The fully qualified name would be treated as a fully qualified name and processed as such.

Your Environment

  • Version used: 3.2.4
  • Configuration:
    includes:
      - c:\test\fluent-bit.yaml
    
  • Operating System and version: Windows 11 24H2
  • Filters and plugins: none

Additional context
This prevents loading configuration files from a non-relative location.

This appears to be caused by:

if (parent && cfg_file[0] != '/') {

This check is insufficient for a Windows environment. The check should determine if the path is "rooted" (begins with a X:) or absolute (begins with a "" or "/"). In either case, the file path can be accepted as is.

A workaround for the current implementation is to prefix the fully qualified path with "//./" which will pass the current check and not interfere with Windows path processing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant