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

make module_name option optional #149

Merged
merged 2 commits into from
May 8, 2024

Conversation

tmu-sprd
Copy link
Contributor

With PR #139 an option module_name was introduced to override the module name. This option is now mandatory, which I assume wasn't intended. This PR makes it optional.

Description:
Deploy module my_module without ?module_name:

echo -e $(curl -s -u"r10kdeploy:DeployPass" -d '{ "project": { "name": "my_module" } }' -H 'Accept: application/json' -H 'X-Gitlab-Event: Push Hook' 'http://localhost:4000/api/v1/r10k/module')

Expected result:

"INFO	 -> Using Puppetfile '/etc/puppetlabs/code/environments/production/Puppetfile'
INFO	 -> Deploying module to /etc/puppetlabs/code/environments/production/modules/my_module
"

Actual result:

{"message":"Invalid module name"}

Explanation:
Matching for an invalid module name should only be done, when the option is given. Not giving the option, the variable overrideModule is an empty string, which does not match the RegEx, throwing the error.

@bastelfreak bastelfreak added the bug Something isn't working label Apr 23, 2024
@genebean
Copy link
Contributor

genebean commented May 7, 2024

I tested this fix in my local copy of the code and it seems to solve the issue for me.

@dhollinger dhollinger merged commit c1bfe09 into voxpupuli:master May 8, 2024
3 checks passed
@tmu-sprd tmu-sprd deleted the fix-module_name-option branch May 13, 2024 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants