-
Notifications
You must be signed in to change notification settings - Fork 21
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
(GH-137) Load Puppet Custom Types, Defined Types and Classes via Puppet API v4 #138
Merged
michaeltlombardi
merged 2 commits into
puppetlabs:master
from
glennsarti:gh-137-use-strings-to-extract-types-classes
Jun 6, 2019
Merged
(GH-137) Load Puppet Custom Types, Defined Types and Classes via Puppet API v4 #138
michaeltlombardi
merged 2 commits into
puppetlabs:master
from
glennsarti:gh-137-use-strings-to-extract-types-classes
Jun 6, 2019
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Blocked on merge for #126 |
glennsarti
changed the title
{BLOCKED}(GH-137) Load Puppet Custom Types, Defined Types and Classes via Puppet API v4
(GH-137) Load Puppet Custom Types, Defined Types and Classes via Puppet API v4
Jun 6, 2019
Now that there is a puppetstrings feature flag, we can change the loading behaviour of the Custom Types to use the newer loader and Puppet Strings metadata evaluation. This commit; * Adds Custom Types ('type') ability to the retrieve_via_puppet_strings method * Custom Types loading isn't fully implemented like Puppet Functions are, in particular there's no use of the Smart Paths, and the loader still uses the old autoload methods. To work around this a new loader is created, which is based on the the NullLoader. It's purpose is to only support the needed discover_path method, however as it's a NullLoader, it won't actually load anything if it's called by Puppet. This loader calls the old autoloader using the same logic we used previously but surfaced via the loader. * Just like the previous loading mechanism, the whit and component types are ignored. * The Puppet Strings helper is updated to support reading the type data from Puppet Strings. Note that class documentation is now available whereas in the current iteration of the sidecar it is not. * The integration tests were updated to test for the new information and that the data can be cached correctly.
…trings Now that there is a puppetstrings feature flag, we can change the loading behaviour of Puppet Classes and Defined Types to use the newer loader and Puppet Strings metadata evaluation. This commit; * Uses a "fake" object type called sidecar_manifest to interrogate the loaders for the information. This is because there's no type name in the loaders which suits our needs. By using such a strict name we can be sure that the default loaders will just ignore it. * The PathDiscoveryNullLoader is updated to discover all of the paths to the manifests in the environment. * The Puppet Strings helper is updated to support reading the type data from Puppet Strings. Note that class documentation is now available whereas in the current iteration of the sidecar it is not. * The integration tests were updated to test for the new information and that the data can be cached correctly.
glennsarti
force-pushed
the
gh-137-use-strings-to-extract-types-classes
branch
from
June 6, 2019 02:22
62d7669
to
c0c7431
Compare
glennsarti
commented
Jun 6, 2019
autoloader = Puppet::Util::Autoload.new(self, 'puppet/type') | ||
current_env = current_environment | ||
|
||
# This is an expensive call |
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.
TODO: this is in the wrong spot.
michaeltlombardi
approved these changes
Jun 6, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Builds on #126 - Merged
Fixes #137
Now that there is a puppetstrings feature flag, we can change the loading
behaviour of the Custom Types to use the newer loader and Puppet Strings
metadata evaluation. This commit;
Adds Custom Types ('type') ability to the retrieve_via_puppet_strings method
Custom Types loading isn't fully implemented like Puppet Functions are, in
particular there's no use of the Smart Paths, and the loader still uses the
old autoload methods. To work around this a new loader is created, which is
based on the the NullLoader. It's purpose is to only support the needed
discover_path method, however as it's a NullLoader, it won't actually load
anything if it's called by Puppet.
This loader calls the old autoloader using the same logic we used previously
but surfaced via the loader.
Just like the previous loading mechanism, the whit and component types are
ignored.
The Puppet Strings helper is updated to support reading the type data from
Puppet Strings. Note that class documentation is now available whereas
in the current iteration of the sidecar it is not.
The integration tests were updated to test for the new information and that
the data can be cached correctly.
Now that there is a puppetstrings feature flag, we can change the loading
behaviour of Puppet Classes and Defined Types to use the newer loader and
Puppet Strings metadata evaluation. This commit;
for the information. This is because there's no type name in the loaders
which suits our needs. By using such a strict name we can be sure that the
default loaders will just ignore it.
manifests in the environment.
Puppet Strings. Note that class documentation is now available whereas
in the current iteration of the sidecar it is not.
the data can be cached correctly.