Default template-url ref changed from origin/master to PDK::VERSION
Describe the bug
Prior to PDK 1.10.0, specifying a custom template repository URL resulted in fetching the master branch of the template repository. PDK 1.10.0 now defaults to a branch matching the PDK version.
To Reproduce
$ pdk new module --template-url ssh://[email protected]/user/puppet-pdk-templates.git
pdk (ERROR): Unable to find a branch or tag named "1.10.0" in file:///tmp/pdk-templates20190424-27149-5neu5c
Or using an answers.json:
{
"template-url": "ssh://[email protected]/user/puppet-pdk-templates.git"
}
$ pdk new module
pdk (ERROR): Unable to find a branch or tag named "1.10.0" in file:///tmp/pdk-templates20190424-31082-1ib182g
Expected behavior
New module is created using the master branch of the template repository without having to specify --template-ref master as in previous versions.
Additional context
- Your PDK installation method (native packages or via Rubygems): RHEL 7 RPM
- Your PDK version (
pdk --version): 1.10.0 - Your operating system / platform: CentOS 7.5 x86_64
Previous ref default of origin/master:
https://github.com/puppetlabs/pdk/blob/f3d1d4bae1a4b514a234b8f5673bdc138225262f/lib/pdk/module/templatedir.rb#L298
https://github.com/puppetlabs/pdk/blob/f3d1d4bae1a4b514a234b8f5673bdc138225262f/lib/pdk/util.rb#L242
Current ref default of PDK::VERSION:
https://github.com/puppetlabs/pdk/blob/0d864aff62ffef04b5104addf399d0476afd71e7/lib/pdk/util/template_uri.rb#L98-L104
https://github.com/puppetlabs/pdk/blob/0d864aff62ffef04b5104addf399d0476afd71e7/lib/pdk/util/template_uri.rb#L214-L220
https://github.com/puppetlabs/pdk/blob/0d864aff62ffef04b5104addf399d0476afd71e7/lib/pdk/version.rb#L1-L4
We have created https://tickets.puppetlabs.com/browse/PDK-1354 to track the resolution of this issue.
We agree that the old behavior of custom templates attempting to track master should have been preserved and it was an oversight that they do not. We will try to get this fixed in the next PDK release.
As a workaround, if you specify --template-ref=master it should remember that branch target in the module's metadata.json file for subsequent invocations of pdk update, etc.
This issue has been marked stale because it is open with no recent activity. The PDK 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.
This issue was closed because it is open with no recent activity. The PDK 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.