Skip to content

Fix instances method with simple_get_filter #304

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

Merged

Conversation

seanmil
Copy link
Contributor

@seanmil seanmil commented Oct 28, 2022

Per issue #303, the Puppet Specification for Resource API indicates that a provider get() method when simple_get_filter is enabled should return all instances when the second/names parameter is set to 'nil'.

Currently, if a Resource API provider is implemented per specification and uses the simple_get_filter feature it will never return any resources for the instances() method, which prevents things such a resource purging from working.

@seanmil seanmil requested a review from a team as a code owner October 28, 2022 13:08
@seanmil
Copy link
Contributor Author

seanmil commented Oct 29, 2022

So, after sleeping on this, I'm not sure that changing the behavior in the code to match the documentation is the right change. It could be a functionally breaking change for someone who wrote code based on the actual implementation and not the documented behavior.

Instead maybe it makes sense to update the documentation. I put up a PR for the Puppet Specifications at puppetlabs/puppet-specifications#155 but the Puppet docs on the docs website would also need to be fixed.

@CLAassistant
Copy link

CLAassistant commented Apr 19, 2023

CLA assistant check
All committers have signed the CLA.

@LukasAud
Copy link
Contributor

Closing and re-opening to re-kick testing.

@LukasAud LukasAud closed this Nov 23, 2023
@LukasAud LukasAud reopened this Nov 23, 2023
Per issue puppetlabs#303, the Puppet Specification for Resource API
indicates that a provider get() method when simple_get_filter
is enabled should return all instances when the second/names
parameter is set to 'nil'.

Currently, if a Resource API provider is implemented per
specification and uses the simple_get_filter feature it
will never return any resources for the `instances()`
method, which prevents things such a resource purging
from working.
@LukasAud LukasAud force-pushed the fix_simple_get_filter_instantiation branch from 1f06330 to ecefc34 Compare November 28, 2023 11:57
Copy link
Contributor

@LukasAud LukasAud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@LukasAud LukasAud added the bug label Nov 28, 2023
@LukasAud LukasAud merged commit 46aa687 into puppetlabs:main Nov 28, 2023
@LukasAud
Copy link
Contributor

@seanmil Apologies for the rebase, I need to make sure this worked on latest.

@seanmil seanmil deleted the fix_simple_get_filter_instantiation branch April 30, 2025 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants