icingaweb2-module-director icon indicating copy to clipboard operation
icingaweb2-module-director copied to clipboard

Overriden service custom properties are incorrectly deployed

Open raviks789 opened this issue 11 months ago • 1 comments

To Reproduce

  • Create a host template generic-host-template.
  • Create a service template generic-service-template.
  • Create and add the following custom properties of data type string to generic-service-template.
    • service_var_a
    • service_var_b
  • Create a service service-a importing template generic-service-template for host generic-host-template.
  • Set the values of custom properties as below.
    • service_var_a: service-value-a
    • service_var_b: service-value-b
  • Create a host template child-host-template importing generic-host-template.
  • Override the value of service_var_a of the inherited service service-a of child-host-template to host-template-value-a.
  • Create a host host-a importing child-host-template.
  • Override the value of service_var_b of the inherited service service-a of host-a to host-value-b.
  • Deploy your changes.
  • The values of custom properties of the deployed service service-a for host-a will be as following: service_var_a: service-value-a service_var_b: host-value-b

The value of service_var_a which was overridden in the inherited service service-a of host template child-host-template is lost.

This has been depicted in the diagrams below.

Director Configuration

classDiagram
    generic-host-template --|> child-host-template
    child-host-template --|> host-a
    generic-service-template --|> service-a
    generic-service-template: custom_vars = [service_var_a, servie_var_b]
    generic-host-template: services = [service-a]
    class child-host-template{
              imports generic-host-template
              inherited services = [service-a]
              vars._override_servicevars = [service-a => [service_var_a = 'host-template-value-a']]
          }
        class host-a{
              imports child-host-template
              inherited services = [service-a]
              vars._override_servicevars = [service-a => [service_var_b = 'host-value-b']]
          }
        class service-a{
              imports generic-service-template
              host = generic-host-template
              vars.service_var_a = 'service-value-a'
              vars.service_var_b = 'service-value-b'
          }

Actual deployed service for host-a

classDiagram
    service-a
    service-a: host = host-a
    service-a: vars.service_var_a = 'service-value-a'
    service-a: vars.service_var_b = 'host-value-b'

Expected deployed service for host-a

classDiagram
    service-a
    service-a: host = host-a
    service-a: vars.service_var_a = 'host-template-value-a'
    service-a: vars.service_var_b = 'host-value-b'

refer: ref/IP/51840

raviks789 avatar Mar 08 '24 10:03 raviks789

#2424

moreamazingnick avatar Mar 13 '24 16:03 moreamazingnick