-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
(PUP-8766) device $LOAD_PATH and environment handling #7242
Conversation
This is only a first draft of the changes that seem to be necessary to get this fixed. I've done only cursory manual testing, and will do a full manual test, and update the unit tests before submitting this for a merge. @joshcooper I'd appreciate feedback on this approach, if this matches what you expected from the conversation in the ticket, and if you see anything that needs improvement |
CLA signed by all contributors. |
96f811b
to
b821073
Compare
The log below shows manual testing how the current
|
The downside here is that puppet device is now ignoring |
This change groups related options in the help text to improve legibility.
Previous to this commit, `puppet device` would use the proxy agent's `:libdir` to load all code, since we changed the `:vardir` setting, but not the `:libdir`. While `Puppet::Settings` has hooks to change the `$LOAD_PATH` when `:libdir` changes, those do not trigger when the change is effected through a interpolation, like in this case. By setting the `:libdir` explicitely the hook is triggered, and the `$LOAD_PATH` gets updated. This commit also removes the `device` subcommand from the CLI's default `$LOAD_PATH` processing.
its really hard to comment on this, the approach looks sane. Not being able to use the --libdir feels like a blocker |
@tphoney about to wrap-up a second iteration of this, fixing the libdir issue |
When running `puppet device` in agent mode, a pluginsync needs to happen before the device is loaded. For the non-agent modes `--facts`, `--resource`, and `--apply`, doing no pluginsync is useful since they are used in local workflows (like testing), and for a quicker turnaround when exploring devices.
b821073
to
83d460b
Compare
There we go. PS: the "force-pushed" link also includes the changes on the 5.5.x branch since I rebased the entire thing. |
This is now ready for final reviews. |
This allows overriding the per-device libdir to enable local and testing scenarios where pluginsync doesn't make sense.
This commit uses a "remote" environment, instead of a full one. This allows the override to work, even if we do not have that environment's codedir available locally. In the case of a full puppet run, the `Configurer` does additional work to update and sync the plugindir vs what the ENC specifies. # Conflicts: # spec/unit/application/device_spec.rb
83d460b
to
e1a810b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
The changes in PUP-8766/puppetlabs#7242 removed plugin loading from a local environment for `puppet device`, even in the cases where local content is supposed to be used. This change reverts the part of puppetlabs#7242 that was causing this. By allowing puppet to load local content for '--apply', '--facts' and '--resource', those run modes can now work stand alone again.
No description provided.