Tile: LDAP `server.attributes` not properly templating into gitlab.rb from `forms:`
This was discovered while investigating https://gitlab.zendesk.com/agent/tickets/77065 That issue was found to be https://gitlab.com/gitlab-org/gitlab-ce/issues/29342
There is no direct relation problems found in the customer ticket, as these values were templated into incorrect keys that resulted in defaults being used (which is what the erroneous keys contained). However, discovery turned out that this was erroneous and should be corrected prior to a customer that does actually make use of non-default values.
Under the LDAP servers:
section, we originally were templating the values out as a YAML string via HEREDOC behaviors in gitlab.rb.erb
. At that time, providing keys of the in the style with underlines would result in a split of the keys on the underscore, and thus server.attributes_username
would actually be a final result of server.attributes.username
.
This was eventually moved to make use of straight ruby object description via .inspect
, which resulted in an oversight of the problem. Tests on the bosh release itself pass, and template correctly, because the properties in the manifest provided for tests contain correct values.
Expected
properties:
ldap:
enabled: true
servers:
- label: S1
...
attributes:
- username: [uid, userid, sAMAccountName]
email: [..]
...
Result
properties:
ldap:
enabled: true
servers:
- label: S1
...
attributes_username: uid, userid, sAMAccountName
attributes_email: mail, email
...