-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removals aren't actioned until environment is redeploy #155
Comments
Can you give me an example so that I can reproduce it? Do you meant a file is removed from the control repository by hand? |
We make use of a mix of forge modules and locally hosted git modules. How to reproduce: Have g10k deploy the change to the environment via the command After the command has completed the removed file is still on disk on the puppet server for that environment in the basedir If I remove the environment and redeploy it, (either by deleting the environment directory or passing the -force flag) the expected behaviour happens, meaning the removed file is not re-deployed Below is the contents of our /etc/g10k.yaml
|
I can't reproduce your bug. I've created a control repository branch called Then I forked a branch of this called After that I merged Then I synced the control repository branch
As you can see the merged removal of the file Are you using the most recent version of g10k? https://github.com/xorpaul/g10k/releases |
Ah, I've found it. This is not a bug, if you want g10k to purge your control repository content from unmanaged files you need to set the See r10k documentation, which I'm trying to emulate: https://github.com/puppetlabs/r10k/blob/master/doc/dynamic-environments/configuration.mkd#purge_levels
I'm setting these purge_level for my test g10k config file, that's why I couldn't reproduce your bug previously: https://github.com/xorpaul/g10k/blob/master/test.yaml#L5-L6 |
I've verified that r10k does exactly the same. Without the |
Thank you very much, I'll adjust our configs appropriately |
Hi, in our setup we run g10k with the following flags ie. Based on the code I see here it looks like the cleanup only works when making use of the -environment flag? Would it be possible to adjust the code to also purge unmanaged content when making use of the -branch flag? |
Nope, it doesn't matter if you use the
Maybe you think that if you're missing the The file also does get deleted without
|
@xorpaul thanks for all the help thus far. We're still struggling to get the desired outcome. The prescribed behaviour works for us on modules that don't exist in the puppetfile, but not on files inside modules/repos that are cloned when updating ie.
File removed/untracked from module repository - simulated:
The latter example is more of a concern for us since we want the contents of the cloned repos to not contain untracked files. |
How did a file inside a Puppetfile managed module get modified/created outside of r10k/g10k? Currently g10k and r10k do not check the content of a module that was not updated by r10k/g10k in the current run:
|
I did that just to illustrate the point, let me illustrate with the actual use case: I just ran the following test to illustrate again:
On the puppetserver:
Great it's there, g10k made sure that the new file is present in the codebase Now the removal of the file in the module repo
On the puppetserver:
The only way to ensure that it is removed, is by either removing it behind g10k's back or using force to remove all environments and recreate them. Neither of these seem like feasible options. |
I can't reproduce your bug. When I'm adding such a file in my test module here: https://github.com/xorpaul/g10k_testmodule/tree/update_master Then deployed the environment via g10k:
Then I removed the test file again:
and triggered the g10k run:
Can you check your g10k yaml config again if you're missing the |
I'm running into this issue currently as well -- I'm not yet able to get cleanup of removed controlrepo files using v0.8.8. My config looks like this:
|
interestingly -- I just noticed my |
This could be a possibility that I'm missing the autocorrected Puppet environment names. Although I don't know if the issue creator is also having his branch name corrected as well. I'll have a look at this later |
Something to note here: If you had the purge settings incorrect and then updated them, you've missed the boat. IE: I rolled my 'production' branch back to before a large delete as 'delete_test' - with purging turned on as I want. It did the right thing and generated types stayed around, etc. Then I merged in production, which then deleted a bunch of files. g10k removed those files. I haven't looked at the code recently, so I'm not sure what the correct fix to this is. |
When there is a file removal and g10k deploys the environment
The removed file is still present until the environment is purged and re-deployed.
The text was updated successfully, but these errors were encountered: