Skip to content

Commit

Permalink
Add feature to specify a custom endpoint name for a host
Browse files Browse the repository at this point in the history
- Render Endpoint and Zone with a different name per host
- Add custom variable `_director_custom_endpoint_name` to a host with that name
- Update `command_endpoint` behavior in services to use custom var or hostname
- Includes a feature flag that needs to be enabled
  • Loading branch information
lazyfrosch authored and Thomas-Gelf committed Oct 21, 2021
1 parent 8237d84 commit 4f95957
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions library/Director/Objects/IcingaHost.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,11 @@ public function renderAgentZoneAndEndpoint(IcingaConfig $config = null)
$config->configFile($pre . 'agent_zones')->addObject($zone);
}

protected function renderCustom_endpoint_name()
protected function renderCustom_endpoint_name($value)
{
// When feature flag feature_custom_endpoint is enabled, render custom var
if ($this->connection->settings()->get('feature_custom_endpoint') === 'y') {
return c::renderKeyValue(
'vars._director_custom_endpoint_name',
c::renderPhpValue($this->get('custom_endpoint_name'))
);
return c::renderKeyValue('vars._director_custom_endpoint_name', c::renderString($value));
}

return '';
Expand Down

0 comments on commit 4f95957

Please sign in to comment.