You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As far as I can tell, vcsrepo supports this only partially.
If revision is omitted (or set to 'HEAD'), the initial git clone sets the working copy to the upstream repo's default branch; subsequent runs do not modify the working copy's revision. Thus, this only works if the desired initial revision matches the upstream repo's default branch.
If revision is specified, then the specified revision is set correctly, but subsequent runs insist on changing the repo to that revision. Thus, this does not allow manual modification of the working copy's revision.
Describe the Solution You Would Like
Option 1
Add a new string parameter initial_revision which, when present, overrides revision only at the time of initial creation. The revision parameter may then be omitted or set to 'HEAD' in order to prevent vcsrepo from changing the revision later.
This option has a drawback of allowing a situation which is almost certainly a mistake:
...which would cause subsequent puppet runs to alter the revision.
Option 2
Add a new boolean parameter enforce_revision, defaulting to true. This parameter may then be set to false in order to prevent vcsrepo from changing the revision later.
Use Case
I want to be able to provide a repository working copy to a target host such that:
This is conceptually the same as providing the initial contents of a file by:
As far as I can tell, vcsrepo supports this only partially.
revision
is omitted (or set to'HEAD'
), the initialgit clone
sets the working copy to the upstream repo's default branch; subsequent runs do not modify the working copy's revision. Thus, this only works if the desired initial revision matches the upstream repo's default branch.revision
is specified, then the specified revision is set correctly, but subsequent runs insist on changing the repo to that revision. Thus, this does not allow manual modification of the working copy's revision.Describe the Solution You Would Like
Option 1
Add a new string parameter
initial_revision
which, when present, overridesrevision
only at the time of initial creation. Therevision
parameter may then be omitted or set to'HEAD'
in order to prevent vcsrepo from changing the revision later.This option has a drawback of allowing a situation which is almost certainly a mistake:
...which would cause subsequent puppet runs to alter the revision.
Option 2
Add a new boolean parameter
enforce_revision
, defaulting totrue
. This parameter may then be set tofalse
in order to prevent vcsrepo from changing the revision later.Describe Alternatives You've Considered
I don't know of any alternatives.
Additional Context
Puppet code (test.pp):
Steps to reproduce:
Observe:
Normally, this is desired behavior, but I would like to be able to override that.
Thanks,
Corey
The text was updated successfully, but these errors were encountered: