Skip to content

Add support for variable parser to handle : as default constant .#9451

Merged
blakerouse merged 9 commits intoelastic:mainfrom
blakerouse:fix-9328
Aug 19, 2025
Merged

Add support for variable parser to handle : as default constant .#9451
blakerouse merged 9 commits intoelastic:mainfrom
blakerouse:fix-9328

Conversation

@blakerouse
Copy link
Contributor

@blakerouse blakerouse commented Aug 18, 2025

What does this PR do?

Adds backwards compatibility for the : that comes from go-ucfg that was originally used in outputs before b59d51a was merged.

The : allows the following characters to be considered a constant where the | considers the following characters as a variable unless wrapped in quotes. This allows ${ELASTICSEARCH_USERNAME:} to be used in outputs and work originally as it used to before variables provider was switch for output replacement.

Why is it important?

This ensures that configurations that used the go-ucfg syntax in output configuration works as it always did, but continues to allow the composable providers in outputs.

Checklist

  • I have read and understood the pull request guidelines of this project.
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in ./changelog/fragments using the changelog tool
  • [ ] I have added an integration test or an E2E test (covered in unit tests)

Disruptive User Impact

None.

Related issues

@blakerouse blakerouse changed the title Add support for variable parser to handle ': as default constant . Aug 18, 2025
@mergify
Copy link
Contributor

mergify bot commented Aug 18, 2025

This pull request does not have a backport label. Could you fix it @blakerouse? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-./d./d is the label that automatically backports to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.
@blakerouse blakerouse added backport-9.1 Automated backport to the 9.1 branch Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team labels Aug 18, 2025
@blakerouse blakerouse changed the title Add support for variable parser to handle : as default constant Aug 18, 2025
@blakerouse blakerouse marked this pull request as ready for review August 18, 2025 19:55
@blakerouse blakerouse requested a review from a team as a code owner August 18, 2025 19:55
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

Copy link
Member

@cmacknz cmacknz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this and it fixes the problem, a couple questions about tests though

@blakerouse blakerouse added backport-8.x Automated backport to the 8.x branch with mergify backport-8.18 Automated backport to the 8.18 branch backport-9.0 Automated backport to the 9.0 branch backport-8.19 Automated backport to the 8.19 branch labels Aug 19, 2025
blakerouse and others added 5 commits August 19, 2025 11:48
Co-authored-by: Craig MacKenzie <craig.mackenzie@elastic.co>
Co-authored-by: Craig MacKenzie <craig.mackenzie@elastic.co>
@blakerouse
Copy link
Contributor Author

@cmacknz This is ready for another review.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

History

cc @blakerouse

@blakerouse blakerouse merged commit c067b6a into elastic:main Aug 19, 2025
19 checks passed
mergify bot pushed a commit that referenced this pull request Aug 19, 2025
…9451)

(cherry picked from commit c067b6a)

# Conflicts:
#	internal/pkg/agent/transpiler/vars_test.go
mergify bot pushed a commit that referenced this pull request Aug 19, 2025
mergify bot pushed a commit that referenced this pull request Aug 19, 2025
mergify bot pushed a commit that referenced this pull request Aug 19, 2025
@blakerouse blakerouse removed the backport-8.18 Automated backport to the 8.18 branch label Aug 20, 2025
blakerouse added a commit that referenced this pull request Aug 20, 2025
…9451) (#9485)

(cherry picked from commit c067b6a)

Co-authored-by: Blake Rouse <blake.rouse@elastic.co>
blakerouse added a commit that referenced this pull request Aug 20, 2025
…9451) (#9486)

(cherry picked from commit c067b6a)

Co-authored-by: Blake Rouse <blake.rouse@elastic.co>
blakerouse added a commit that referenced this pull request Aug 20, 2025
…9451) (#9484)

(cherry picked from commit c067b6a)

Co-authored-by: Blake Rouse <blake.rouse@elastic.co>
kaanyalti pushed a commit to kaanyalti/elastic-agent that referenced this pull request Sep 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-8.x Automated backport to the 8.x branch with mergify backport-8.19 Automated backport to the 8.19 branch backport-9.0 Automated backport to the 9.0 branch backport-9.1 Automated backport to the 9.1 branch Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team

3 participants