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

Throw config error when using global zones as parent #6379

Merged
merged 1 commit into from Jul 26, 2018

Conversation

Crunsher
Copy link
Contributor

Disallow global zones as parent

object Endpoint "foo" {
}

object Zone "fooz" {
	endpoints = [ "foo" ]
	parent = "global-templates"
}

object Zone "director-global" {
	global = true
}

used to be allowed, now this output is expected:

$ icinga2 daemon -C
[2018-06-15 14:43:03 +0200] information/cli: Icinga application loader (version: v2.8.4-748-gee9be90fa)
[2018-06-15 14:43:03 +0200] information/cli: Loading configuration file(s).
[2018-06-15 14:43:04 +0200] information/ConfigItem: Committing config item(s).
[2018-06-15 14:43:04 +0200] information/ApiListener: My API identity: jfws
[2018-06-15 14:43:05 +0200] critical/config: Error: Zone 'fooz' can not have a global zone as parent.
Location: in /home/jflach/i2/etc/icinga2/zones.conf: 33:1-33:18
/home/jflach/i2/etc/icinga2/zones.conf(31): }
/home/jflach/i2/etc/icinga2/zones.conf(32): 
/home/jflach/i2/etc/icinga2/zones.conf(33): object Zone "fooz" {
                                            ^^^^^^^^^^^^^^^^^^
/home/jflach/i2/etc/icinga2/zones.conf(34):  endpoints = [ "foo" ]
/home/jflach/i2/etc/icinga2/zones.conf(35):  parent = "global-templates"

[2018-06-15 14:43:05 +0200] critical/config: 1 error

@Crunsher Crunsher added the area/configuration DSL, parser, compiler, error handling label Jun 15, 2018
@dnsmichi
Copy link
Contributor

Will be merged after 2.9.

@dnsmichi dnsmichi added the TBD To be defined - We aren't certain about this yet label Jun 15, 2018
@dnsmichi dnsmichi added this to the 2.10.0 milestone Jul 3, 2018
@dnsmichi dnsmichi added enhancement New feature or request and removed TBD To be defined - We aren't certain about this yet labels Jul 26, 2018
@dnsmichi dnsmichi merged commit 038b2fb into master Jul 26, 2018
@dnsmichi dnsmichi deleted the global-zone-validation branch July 26, 2018 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/configuration DSL, parser, compiler, error handling enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants