Skip to content

ocp4_workload_showroom: multi-user AgnosticD deployment is broken #7785

@btison

Description

@btison
Contributor

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:

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(10)}}
{% endfor %}

However, when setting the userdata variable for the Helm chart, the userData variable is not used, but rather _showroom_user_data

user_data: |-
{{ _showroom_user_data | to_nice_yaml | indent(16) }}

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.

Activity

newgoliath

newgoliath commented on Apr 10, 2024

@newgoliath
Collaborator

Per the README.adoc, do not use this feature until we revisit after summit. Use the helm install path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @btison@newgoliath

        Issue actions

          ocp4_workload_showroom: multi-user AgnosticD deployment is broken · Issue #7785 · redhat-cop/agnosticd