Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

tbavelier
Copy link
Member

@tbavelier tbavelier commented Apr 9, 2025

What does this PR do?

Explicitly convert matches in the agent_version extraction to integers instead of type casting using 0 + $group. Supporting doc: https://github.com/puppetlabs/docs-archive/blob/main/puppet/4.6/function.md#conversion-to-integer

Motivation

Avoid warnings "was automatically coerced to the numerical value"

Additional Notes

  • We specify radix 10 to avoid potential false radix detection (e.g. we do not want to convert to hexadecimal or other systems)
  • Such warning are non-blocking UNLESS strict=error mode is enforced

Describe your test plan

Ensured you can still install specific agent versions, e.g. using agent_version => 1:7.37.1-1

@tbavelier tbavelier requested review from a team as code owners April 9, 2025 08:37
@tbavelier tbavelier changed the title Explicitly convert matches instead of type casting [AGENT-13568] Explicitly convert matches instead of type casting Apr 9, 2025
@tbavelier tbavelier merged commit 71d0a36 into main Apr 9, 2025
12 checks passed
@tbavelier tbavelier deleted the tbavelier/explicitly-convert-to-integer branch April 9, 2025 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants