Skip to content

HostgroupRestriction: Allow creation of hosts if they match restricted groups filter#3003

Merged
raviks789 merged 1 commit intomasterfrom
fix/creation-of-host-matching-group-filters
Feb 11, 2026
Merged

HostgroupRestriction: Allow creation of hosts if they match restricted groups filter#3003
raviks789 merged 1 commit intomasterfrom
fix/creation-of-host-matching-group-filters

Conversation

@raviks789
Copy link
Copy Markdown
Collaborator

fixes #2876

@raviks789 raviks789 added this to the v1.12.0 milestone Aug 1, 2025
@raviks789 raviks789 requested a review from nilmerg August 1, 2025 14:36
@raviks789 raviks789 self-assigned this Aug 1, 2025
@cla-bot cla-bot bot added the cla/signed label Aug 1, 2025
@slalomsk8er
Copy link
Copy Markdown

Does this relate to icingacli director hostgroups refreshMembers provides by:

diff --git a/application/clicommands/HostgroupsCommand.php b/application/clicommands/HostgroupsCommand.php
index 1007a05a..bfcfbe3c 100644
--- a/application/clicommands/HostgroupsCommand.php
+++ b/application/clicommands/HostgroupsCommand.php
@@ -3,6 +3,8 @@
 namespace Icinga\Module\Director\Clicommands;

 use Icinga\Module\Director\Cli\ObjectsCommand;
+use Icinga\Module\Director\Objects\HostGroupMembershipResolver;
+use ReflectionClass;

 /**
  * Manage Icinga Hostgroups
@@ -11,4 +13,11 @@ use Icinga\Module\Director\Cli\ObjectsCommand;
  */
 class HostgroupsCommand extends ObjectsCommand
 {
+    public function refreshMembersAction()
+    {
+        $resolver = new HostGroupMembershipResolver($this->db());
+        $reflection = new ReflectionClass($resolver);
+        $reflection->getMethod('getObjects')->invoke($resolver);
+        $resolver->refreshDb(true);
+    }
 }

in any way?

Copy link
Copy Markdown
Member

@nilmerg nilmerg left a comment

Choose a reason for hiding this comment

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

Seems fine I guess.

@raviks789 raviks789 modified the milestones: v1.12.0, v1.11.6 Jan 15, 2026
@raviks789 raviks789 force-pushed the fix/creation-of-host-matching-group-filters branch 2 times, most recently from 2098156 to e3c0f09 Compare February 5, 2026 09:23
@raviks789 raviks789 requested a review from lippserd February 6, 2026 07:21
@raviks789 raviks789 force-pushed the fix/creation-of-host-matching-group-filters branch from e3c0f09 to dd3667e Compare February 10, 2026 12:12
@raviks789 raviks789 force-pushed the fix/creation-of-host-matching-group-filters branch from dd3667e to 8e66b4f Compare February 11, 2026 15:56
@raviks789 raviks789 removed the request for review from lippserd February 11, 2026 16:02
@raviks789 raviks789 merged commit b4f2a44 into master Feb 11, 2026
13 checks passed
@raviks789 raviks789 deleted the fix/creation-of-host-matching-group-filters branch February 11, 2026 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Users with Director restrictions unable to create hosts unless you manually specify the host group

3 participants