Skip to content
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

Add support for strip_component #202

Closed
wants to merge 1 commit into from

Conversation

andni233
Copy link

@andni233 andni233 commented Oct 5, 2022

r10k supports a source configuration option strip_component: https://github.com/puppetlabs/r10k/blob/main/doc/dynamic-environments/configuration.mkd#strip_component

This adds similar support to g10k.

r10k supports a source configuration option `strip_component`:
https://github.com/puppetlabs/r10k/blob/main/doc/dynamic-environments/configuration.mkd#strip_component

This adds similar support to g10k.
@xorpaul
Copy link
Owner

xorpaul commented Oct 5, 2022

Wow, cool. Thanks for this, let me check if I can add a test for this feature before merging.

@xorpaul xorpaul self-assigned this Nov 18, 2022
@xorpaul
Copy link
Owner

xorpaul commented Nov 18, 2022

Closed in favor of #204

I had to reshuffle some things as we don't want to rename the Puppet environment at the end when we're untar the git repository as we have a section for this already here https://github.com/xorpaul/g10k/pull/204/files#diff-900e9873f6417c9eea63c4ed0761750bd4f836dca36020932d8414a1312076a3

We also don't want to check for the strip_component on every module based on a git repository.

While creating the dedicated tests for this feature, I came across the following bug:
What happens when you have branches like

  • env/main
  • main
    and your strip_component set to env/? The renamed Puppet env would be the same as the original main.
    Do you know how r10k checks for this?

I already had a map with all renamed Puppet envs available, so checking for that was pretty easy, but the user still has to find out why such a conflict occurred as I don't print which feature was responsible for the renaming in the error output. This is also here at the bottom https://github.com/xorpaul/g10k/pull/204/files#diff-900e9873f6417c9eea63c4ed0761750bd4f836dca36020932d8414a1312076a3

Anyway thank you @andni233 for the feature request!

@xorpaul xorpaul closed this Nov 18, 2022
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