Describe the bug
Multi-user AgnosticD deployment uses an applicationset to deploy showroom for each user. To propagate the user-specific data into the each application of the set, the list generator is used to build a yaml representation of the user data:
This doesn't work as the user data are not parsed and segmented per user, so when deploying showroom, the user data configmap contains the userdata for all the users.
Apparently the issue is that in the applicationset template, it is not possible to correctly indent the userData yaml when setting the Helm chart variable.
Possible fix
A possible (very hacky) solution for this issue consists of of playing with the indent in the applicationset template:
In the list generator:
generators:
- list:
elements:
{% for n in range(1, _user_count | int + 1 ) %}
- user: user{{ n }}
userData: |
{{ _showroom_user_data['users']['user'~n] | to_nice_yaml | indent(14)}}
{% endfor %}
(indent 14 instead of 10)
When setting the Helm value:
user_data: |
{% raw %}{{.userData}}{% endraw %}
Another fix would be to not use an applicationset, but loop through the users and user data, and deploy an Argo application per user.
Describe the bug Multi-user AgnosticD deployment uses an applicationset to deploy showroom for each user. To propagate the user-specific data into the each application of the set, the list generator is used to build a yaml representation of the user data:
https://github.com/redhat-cop/agnosticd/blob/25a25e545696dc013e9a51fd9352b519b103d9c0/ansible/roles_ocp_workloads/ocp4_workload_showroom/templates/applicationset.yaml.j2#L9-L16
However, when setting the userdata variable for the Helm chart, the
userData
variable is not used, but rather_showroom_user_data
https://github.com/redhat-cop/agnosticd/blob/25a25e545696dc013e9a51fd9352b519b103d9c0/ansible/roles_ocp_workloads/ocp4_workload_showroom/templates/applicationset.yaml.j2#L76-L77
This doesn't work as the user data are not parsed and segmented per user, so when deploying showroom, the user data configmap contains the userdata for all the users.
Apparently the issue is that in the applicationset template, it is not possible to correctly indent the
userData
yaml when setting the Helm chart variable.Possible fix
A possible (very hacky) solution for this issue consists of of playing with the indent in the applicationset template:
In the list generator:
(indent 14 instead of 10)
When setting the Helm value:
Another fix would be to not use an applicationset, but loop through the users and user data, and deploy an Argo application per user.