puppetlabs / r10k

Smarter Puppet deployment
Other
800 stars 354 forks source link

Yaml environments fails to deploy banch when commit sha is a number #1309

Closed logicminds closed 2 years ago

logicminds commented 2 years ago

Describe the Bug

If the version value has a commit sha that is all numbers (rare) the yaml parser will parse that as an integer instead of a string. Since r10k expects a string it throws an exception due to invalid type. This will cause the environment deployment to fail as a result.

edge:
  type: git
  source: git@github.com:nwops/puppet-kontrol-repo.git
  version: 123445678

Expected Behavior

While I don't expect YAML to treat this version data any different I do expect r10k to auto convert the number to a string instead of throwing an error.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Setup your puppet infra to use a YAML based environment
  2. Deploy a r10k yaml environmemnt file with similar to reference above
  3. Assign the version to a commit sha that has all numbers (commit doesn't actually need to exist)
  4. Run r10k deploy edge -w

Environment

Additional Context

The work around is to surround the version within quotes which forces a string

github-actions[bot] commented 2 years ago

This issue has been marked stale because it has had no activity for 60 days. The Puppet Team is actively prioritizing existing bugs and new features, if this issue is still important to you please comment and we will add this to our backlog to complete. Otherwise, it will be closed in 7 days.