Conversation
|
Daniel Henninger seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
| def create | ||
| Puppet.info("Running compose project #{name}") | ||
| args = ['compose', compose_files, '-p', name, 'up', '-d', '--remove-orphans'].insert(3, resource[:options]).insert(5, resource[:up_args]).compact | ||
| args = ['compose', compose_files, '-p', name, 'up', '-d', '--remove-orphans'].insert(3, resource[:options]).insert(6, resource[:up_args]).compact |
There was a problem hiding this comment.
The usage of #insert make it a bit hard to follow. I think we could benefit from re-writing this as something like:
args = ['compose', compose_files, '-p', name, resource[:options], 'up', resource[:up_args], '-d', '--remove-orphans'].flatten.compact(assuming the index of the first insert is wrong because I don't think it is correct to insert resource[:options] between -p and name).
Also consistently using long options helps for readability: -p => --project-name, -d => --detach
There was a problem hiding this comment.
If y'all want to do it a different way that's certainly cool with me. =) I needed this fixed asap and submitted my fix without modifying the way things are done too much.
There was a problem hiding this comment.
(fwiw i agree -- i don't entirely understand why it was done the way it was)
Summary
Fixes issue #984 where up_args are being placed before up, and need to go after.
Additional Context
Since 'compose' became an argument, the insert statement just need to be incremented by one to represent the new position. The other insert seems fine where it is.
Related Issues (if any)
#984
puppet apply)