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

Allow proxy minion types to be dynamically loaded #50183

Merged
merged 7 commits into from Nov 16, 2018
Merged

Conversation

@cro
Copy link
Member

@cro cro commented Oct 23, 2018

What does this PR do?

This PR creates a new loadable module type called a metaproxy and abstracts the existing proxy minion to become a type of metaproxy. This enables us to build different types of proxy minions that can still load existing proxymodules.

Tests written?

No, but existing tests for proxy minions pass successfully.

Commits signed with GPG?

Yes

@cro cro requested a review from as a code owner Oct 23, 2018
@ghost ghost self-requested a review Oct 23, 2018
Copy link
Contributor

@gtmanfred gtmanfred left a comment

instead of having these larger if statements, can we just put those

if opts is None:
    opts = __opts__

At the top?

if not opts:
ckminions = salt.utils.minions.CkMinions(__opts__)
else:
ckminions = salt.utils.minions.CkMinions(opts)
Copy link
Contributor

@gtmanfred gtmanfred Oct 23, 2018

Choose a reason for hiding this comment

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

can we just make this ckminions = salt.utils.minions.CkMinions(opts or __opts__) and get rid of the rest of the if statement?

if not opts:
ckminions = salt.utils.minions.CkMinions(__opts__)
else:
ckminions = salt.utils.minions.CkMinions(opts)
Copy link
Contributor

@gtmanfred gtmanfred Oct 23, 2018

Choose a reason for hiding this comment

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

same here

@rallytime
Copy link
Contributor

@rallytime rallytime commented Oct 25, 2018

@cro This has several lint failures as well as some test failures. Can you take a look?

@rallytime
Copy link
Contributor

@rallytime rallytime commented Oct 29, 2018

@cro
Copy link
Member Author

@cro cro commented Oct 29, 2018

Yes, looks like they are related to the ProxyCaller. I am looking more closely at it now.

@cro cro force-pushed the metaproxy branch 2 times, most recently from 796ce64 to d4c15f7 Oct 31, 2018
@cro cro closed this Oct 31, 2018
@cro cro reopened this Oct 31, 2018
@gtmanfred gtmanfred closed this Oct 31, 2018
@gtmanfred gtmanfred reopened this Oct 31, 2018
@cro cro force-pushed the metaproxy branch 3 times, most recently from 174e1de to e35eb6a Nov 6, 2018
@cro cro force-pushed the metaproxy branch 2 times, most recently from a89d442 to 12c147a Nov 13, 2018
if not opts:
opts = __opts__
nodegroups = opts.get('nodegroups', {})
matchers = salt.loader.matchers(opts)
Copy link
Collaborator

@terminalmage terminalmage Nov 14, 2018

Choose a reason for hiding this comment

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

If you added a __matchers__ dunder to the packed items, similar to what we do for __salt__ in minion_mods, then you don't need to instantiate a new LazyLoader here. I get that we might still need to do it, in cases where actual opts are passed in, but it shouldn't be necessary in most cases.

@cachedout cachedout merged commit b210d80 into saltstack:develop Nov 16, 2018
4 of 11 checks passed
garethgreenaway added a commit to garethgreenaway/salt that referenced this issue Jul 24, 2019
dwoz added a commit that referenced this issue Aug 8, 2019
[2019.2.1] Porting metaproxy changes in #50183 to 2019.2.1
Akm0d added a commit to Akm0d/salt that referenced this issue Aug 21, 2019
@waynew waynew added this to PR needs port to master in PRs to port to master Oct 24, 2019
@garethgreenaway garethgreenaway moved this from PR needs port to master to Failed: Skips, War room, CI Changes, Change already there in PRs to port to master Mar 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
PRs to port to master
  
Failed: Skips, War room, CI Changes, ...
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants